0

I have following lines of code:

System.Reflection.AssemblyName assemblyName = System.Reflection.AssemblyName.GetAssemblyName(@"C:\inetpub\wwwroot\wss\VirtualDirectories\22687\bin\log4net.dll");

After executing it, I get a System.IO.FileLoadException - Could not load file or assembly or one of its dependencies. Access is denied.. If i copy the file and try the same in a different directory (for example: @"C:\inetpub\wwwroot\wss\VirtualDirectories\22687\log4net.dll") I don't get the Exception, even if I set the permission for the file exactly the same. Can anyone point me to the right direction?

I'm running Windows Server 2008R2, SharePoint 2010, IIS7 and Visual Studio 2010.

edit: It works on LINQPad. I run the Application from the IIS App Pool under the same user as the LINQPad Process.

Nicolas
  • 950
  • 1
  • 7
  • 15
  • Is your SharePoint using Windows authentication? SharePoint sets `` so file access would use the user's permissions. – Steve Young May 08 '14 at 13:52
  • It is. But if I run LINQPad under my current user and I'm calling the same method, it works. Nevertheless, since the permissions are equal of the 2 files, 1 works, the other not, I don't know where the problem could be – Nicolas May 08 '14 at 14:28

0 Answers0