“无法加载文件或程序集 XYZ”的原因是什么?错误?
我一定是疯了,对吧?
几天以来我一直收到类似的错误
MyAssembly 无法加载文件或程序集“AnotherAssembly,Version=1.0.0.0,Culture=neutral,PublicKeyToken=”或其依赖项之一。访问被拒绝 C:\work\Assemblies\something\MyAssembly\SGEN
我认为这是我在处理我正在开发的功能期间所做的事情。然后今天我有理由从两个月前的仓库中检查代码。并得到同样的错误。
什么?!我知道这个代码两个月前构建得很好,它正在生产中运行!
微软是否推出了一些让事情变得混乱的更新,或者是什么?
I must be going mental, right?
Since a couple of days I have been getting errors like
MyAssembly Could not load file or assembly 'AnotherAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=' or one of its dependencies. Access denied C:\work\Assemblies\something\MyAssembly\SGEN
I thought it was something I'd done during my work on the feature I'm working on. Then today I had reason to check code out of our repo from two months ago. And got the same error.
What?! I know for a fact that that code built fine two months ago, it's running in production!
Has Microsoft pushed some update that has messed things up, or what?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嗯,有一个非常具体的错误消息“访问被拒绝”。这可以引用“AnotherAssembly”或“AnotherAssembly”所需的程序集。这很可能是您的开发计算机上的某些权限的问题,而不是其他问题。
Well, there is a pretty specific error message "Access denied". This could refer to "AnotherAssembly" or an assembly that is needed by "AnotherAssembly". This most likely is a problem with some rights on your development machine and nothing else.
错误的“访问被拒绝”部分似乎表明存在安全问题。假设您使用的是开发盒并且可以自由更改安全设置,请尝试为所有用户提供对错误中提到的文件夹的读/写控制权(
C:\work\Assemblies\something\MyAssembly\SGEN
)另外,如果它是一个 Web 应用程序,请尝试清除临时 asp.net 文件 (
%SystemRoot%\Microsoft.NET\Framework\versionNumber\Temporary ASP.NET Files
) 并提供给它所有用户的读/写权限。The "Access denied" part of the error seems to point to a security problem. Assuming that you're on a development box and can change security settings freely, try giving all users read/write control to the folder mentioned in the error (
C:\work\Assemblies\something\MyAssembly\SGEN
)Also, if it's a web application try clearing your temp asp.net files (
%SystemRoot%\Microsoft.NET\Framework\versionNumber\Temporary ASP.NET Files
) and giving it read/write access to all users.