Yash

Yash

  • 1.6k
  • 129
  • 8.9k

Referencing Microsoft interop dll issue

Nov 25 2019 12:56 AM

I am writing a pgm to read outlook-2016 mails from windows7 on VS2019 IDE with .net core framework on C# console app. I have used the code available at https://www.youtube.com/watch?v=zt2HbqwR-WI for Building the code has no issue. but while running i am getting below issue related to referencing dlls. I tried two versions of interop library and added reference manually as well as via manage nuget. But the same error always:

"An unhandled exception of type 'System.IO.FileNotFoundException' occurred in ReadMailProject.dll Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified."

when i referenced Version=9.6.0.0 of interop……..

"An unhandled exception of type 'System.IO.FileNotFoundException' occurred in ReadMailProject.dll
Could not load file or assembly 'Interop.Microsoft.Office.Interop.Outlook, Version=9.6.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified."

Thanks in advance,

Yashaswini


Answers (3)