Failed to load file or assembly (nopcommerce 3.5) when changing to release

I have a new nopcommerce 3.5 site that I want to publish and everything was fine on debugging, but as soon as I changed to free im, I got this error

Error 1 Could not load file or assembly 'file:///C:\Users\User\Desktop\nop\packages\Autofac.3.5.2\lib\net40\Autofac.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) C:\Users\User\Desktop\nop\Libraries\Nop.Services\SGEN Nop.Services 

and I looked over the network and did everything I could, and it just doesn't work.

What I've done.

  • clean and rebuild
  • restart vs
  • I reloaded a new copy of the code and the same thing happened
  • deleted all links and restored
+6
source share
5 answers

OK, that's how I solved it.

Files were locked using windows and were only visible when debugging

I had to go into every DLL file that appeared in the error, and the UNBLOCK button appeared in the properties, and in those that I applied, the changes disappeared.

+4
source

Instead of unlocking all the files one by one, you can do this from the root folder using Windows PowerShell:

dir D: \ Projects \ Nop -recurse | Unlock file

+1
source

To unlock files, use this command in Windows Powershell:

 gci PASTE_FOLDER_PATH_HERE\*.dll -Recurse | Unblock-File 

1) "gci" is used to download all files located on the specified path.
2) "-Recurse" is used to download files located in subfolders of the specified path.

+1
source

Yes, it worked for me with one right-click on NopCommerce \ packages \ Autofac.3.5.2 \ lib \ net40 \ AutoFac.dll , then Unlock and finally click OK , this will solve the problem. I solved this problem this way.

0
source

fooobar.com/questions/684431 / ...

 get-childitem *.*| Unblock-File 

For those who are limited in their PowerShell options:

 FOR %a in (*.*) do (echo.>%a:Zone.Identifier) 
0
source

Source: https://habr.com/ru/post/987616/


All Articles