Could not load file or assembly 'someProject' or one of its dependencies. Access is denied

南楼画角 提交于 2019-11-26 23:13:26

问题


I am stuck with one asp.net error. My application work fine on development and test environemnt. But on production it give me following error:

Could not load file or assembly 'someProject' or one of its dependencies. Access is denied.


回答1:


Go to Sysinternals and download Process Monitor: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

Then start it up, filter thread and registry actions away. Clear contents. Run your app and get the error, and then stop the collection in process monitor. Now search for an ACCESS DENIED status, and you'll be able to see the exact file that's causing troubles, as well as the user account trying to get access.




回答2:


Just delete the bin folder and then agian copy it. Now, it is working...




回答3:


Give full permissions to the running user or group (like MACHINE\users group or DOMAIN\domain users) in

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

Use your target .net version number instead of v4.0.30319 if it's other than .net 4.0.




回答4:


After deploying a new Web API project to our web farm, one of our web servers was malfunctioning and giving the error:

Could not load file or assembly 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Access is denied.

It turns out the folder hosting the Web API site was missing permissions for IIS_IUSRS. Adding the user with Read, Read & execute, and List folder contents permissions fixed the issue.




回答5:


In my case by changing application pool identity from applicationpoolidentity to network service it works hope this will help you.




回答6:


Check that the server user has access to the directory where your assemblies are located.




回答7:


Sounds like an incorrectly configured server.

First, verify that the assembly does indeed exist.

Second, verify that your worker process account has access to it.



来源:https://stackoverflow.com/questions/809144/could-not-load-file-or-assembly-someproject-or-one-of-its-dependencies-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!