I'm having this weird problem with IIS 7 on Windows 7, where it can't load a dll I'm using. However, it seems to only happen after a while; it works fine for some random amount of time until it starts throwing this message:
我在Windows 7上遇到了这个奇怪的问题,它无法加载我正在使用的DLL。然而,它似乎只是在一段时间后发生;它可以在一段随机的时间内正常工作,直到它开始抛出此消息:
Could not load file or assembly 'Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. Access is denied.
If I delete the dll and re-add it, it works fine for another length of time, and later stops working again. This is happening in both an asp.net webpage as well as a web service, however in a normal .net desktop program it works fine.
如果我删除了dll并重新添加它,它可以在另一段时间内正常工作,之后又会再次停止工作。这在asp.net网页和Web服务中都会发生,但是在普通的.net桌面程序中,它可以正常工作。
This only happens with Mono.Security, not with any other dll I'm using (I'm using Npgsql which is dependent on Mono.Security).
这只发生在Mono.Security上,而不是我正在使用的任何其他dll(我正在使用依赖于Mono.Security的Npgsql)。
If anyone could offer some insight into this, it would be great.
如果有人能对此提供一些见解,那就太好了。
2 个解决方案
#1
4
Check file permissions on the DLL file / folder, to make sure your ASP.NET AppPool account can access the file.
检查DLL文件/文件夹上的文件权限,以确保您的ASP.NET AppPool帐户可以访问该文件。
Make sure the file's permissions don't inherit from parent - something might be resetting these.
确保文件的权限不从父级继承 - 可能会重置这些权限。
#2
0
Perhaps you are performing a backup during those times? Just a shot in the dark... Also, in your web.config you don't need to define the version, culture, or public key in order to use the assembly.. Maybe that has something to do with it.
也许你在那段时间里进行备份?只是在黑暗中拍摄...另外,在你的web.config中你不需要定义版本,文化或公钥来使用程序集。也许这与它有关。
#1
4
Check file permissions on the DLL file / folder, to make sure your ASP.NET AppPool account can access the file.
检查DLL文件/文件夹上的文件权限,以确保您的ASP.NET AppPool帐户可以访问该文件。
Make sure the file's permissions don't inherit from parent - something might be resetting these.
确保文件的权限不从父级继承 - 可能会重置这些权限。
#2
0
Perhaps you are performing a backup during those times? Just a shot in the dark... Also, in your web.config you don't need to define the version, culture, or public key in order to use the assembly.. Maybe that has something to do with it.
也许你在那段时间里进行备份?只是在黑暗中拍摄...另外,在你的web.config中你不需要定义版本,文化或公钥来使用程序集。也许这与它有关。