6

I have a web service that downloads a file from a Windows Azure Service Bus. However as soon as I call the method that connects to azure to download the file I get the following error.

An exception of type 'System.IO.FileLoadException' occurred in MyWebService.dll but was not handled in user code

Additional information: Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=3.1.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I have checked the versions of azure I am using and all are version 3.1.0.1.

enter image description here

Community
  • 1
  • 1
Ben Sharpe
  • 799
  • 1
  • 11
  • 22

2 Answers2

2

I think the Problem in your case is Windows is blocking the DLL from being referenced . You need to first "Unblock" it first and then add Refernce ..

Refer this link : Could not load assembly, Exception from HRESULT: 0x80131040

Community
  • 1
  • 1
spetzz
  • 679
  • 8
  • 19
  • On Windows 10 and 11 it's checkbox at the bottom of the file properties dialog's general tab. – Slion Mar 28 '22 at 10:19
0

Right click on the DLL in file explorer to open the properties dialog. On Windows 10 and 11 at the bottom of the general tab there is a checkbox you need to tick to enable use of your DLL.

enter image description here

Slion
  • 2,558
  • 2
  • 23
  • 27