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.