Error : Could not load file or assembly or one of its dependencies
Solution to "Could not load file or assembly or one of its dependencies. Access is denied"
Solution to "Could not load file or assembly or one of its dependencies. Access is denied"
This is one of the most irritating build errors a developer might see,
especially while setting up an existing .NET application on a fresh
machine.
I have found one solution that works always. Go to "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" (
Modify the framework version, root directory etc according to your
environment. ) Now, right-click and open up the Security tabs for this
folder. Grant "Full control" to the 'users' group. (Modify will also
work, thought I didn't try it out) However, it this is a security
problem for your environment to grant full control to all users in Users
group, another Solution could be to put the concerned assemblies lo GAC
which I avoided as it was not logical to put the assemblies into GAC
in my scenario.
Still Have a Problem Do like this and check once
1- check if you are referencing an assembly which in turn referencing an old version of unity. for example let's say you have an assembly called ServiceLocator.dll which needs an old version of Unity assembly, now when you reference the ServiceLocator you should provide it with the old version of Unity, and that makes the problem.
2- may be the output folder where all projects build their assemblies, has an old version of unity.
3 -Try to clean Debug and Release folders in your solution. Ant then remove and add unity again
4 -Remove Temporary Files C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
Close VSTS and Open Again and build the application .
Hope this helps you ...
Comments
Post a Comment