I have a small project in C# that uses two external dll files. One is the Redmine.Net.Api.dll and the other is NLog.dll. I'm using Visual Studio 2010. I added both files as Reference to my project. The problem is that when I run the project in Debug mode, it compiles, but when I switch to Release, it says:
Error 1 Could not load file or assembly 'file:///C:\project\lib\Redmine.Net.Api.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) C:\project\SGEN project
How can I fix this?
Did you download Redmine.Net.Api
dll from the web? If yes, then browse to it with Windows Explorer, right click on it and choose properties. There you should click 'Unblock'. It might have been blocked for some reasons.
Found two items related to this one is saying to checking if your file is blocked (with some changed to your app.config) and another with changes to your project file. Hope this helps.
That occurred to me when I was debugging the remote code in release mode; changed it to debug mode and got it fixed.
Add <loadFromRemoteSources enabled="true" />
to your app.config file as shown below.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
...
</configuration>
User contributions licensed under CC BY-SA 3.0