Permissions to load assembly at runtime in ASP.NET MVC

3

I'm currently working on a function for my website that should work like this:

  • User upload an dll
  • I load the dll inside another app domain (with Assembly.LoadFrom) to inspect it with reflection
  • Unload the app domain and delete the .dll file

This works perfectly fine when I do it locally but when I upload it to my server I get:

Failed to generate files: Could not load file or assembly '/the/path' or one 
of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

So the "Operation is not supported" make me a bit curious. Is it some kind of permission that I need to set the server? Or is it something I can fix through my config? Or is it simply that my server actually don't support it at all?

The only information I can see on my Windows/IIS server is that it use .NET version 4.

c#
asp.net
.net
asp.net-mvc
.net-assembly
asked on Stack Overflow Feb 27, 2017 by MilleB • edited Feb 27, 2017 by Jester

1 Answer

1

Set project Property Local copy = true ,if you are loading using reflection then provide deployment Item at Class level it will work.

answered on Stack Overflow Feb 28, 2017 by Ashu

User contributions licensed under CC BY-SA 3.0