开发者

What is the cause of "Could not load file or assembly XYZ" erros?

开发者 https://www.devze.com 2023-04-02 03:56 出处:网络
I must be going mental, right? Since a couple of days I have been getting errors like MyAssemblyCould not load file or assembly \'AnotherAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=\

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 开发者_JS百科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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消