Error 1 Could Not Load The Assembly File
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about powershell operation is not supported. (exception from hresult: 0x80131515) hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges visual studio could not load file or assembly or one of its dependencies Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. could not load file or assembly visual studio 2013 Join them; it only takes a minute: Sign up VSTS 2010 SGEN : error : Could not load file or assembly (Exception from HRESULT: 0x80131515) up vote 93 down vote favorite 20 I am experiencing a strange issue visual studio could not load file or assembly the system cannot find the file specified with VS2010. We use TFS to build our API dlls and we used to reference them in our projects usign a mapped network drive that was fully trusted. We have been working like that for at least two years and everything worked perfectly. Today, I converted a webapp to vs2010 and when I compile it in Release, it's giving me: SGEN : error : Could not load file or assembly 'file:///L:\Api\Release API_20100521.1\Release\CS.API.Exceptions.dll' or one of its dependencies. Operation
Sgen Error Could Not Load File Or Assembly Or One Of Its Dependencies
is not supported. (Exception from HRESULT: 0x80131515) The strange thing is that it's working when it's under the Debug profile... I tried adding the
Error "Could not load file or assembly 'file://\\server\path\file.dll' or one of its dependencies. (0x80131515) Issue Call to a .NET Framework assembly on a network folder fails with error: "Could not load
Unblock All Dlls In A Folder
file or assembly 'file://\\server\path\file.dll' or one of its dependencies. Operation is not supported. (Exception could not load file or assembly or one of its dependencies c# from HRESULT: 0x80131515) Troubleshooting In this particular case, I wanted to call an assembly with tests which had been deployed using could not load file or assembly visual studio 2015 Team Build to a shared folder, then use MSTest in the command line to run them. MSTest behaved differently depending on whether it is being called from a Windows 2008 R2 Standard server or Windows 8 http://stackoverflow.com/questions/3007190/vsts-2010-sgen-error-could-not-load-file-or-assembly-exception-from-hresult Client. Using the following command line: MSTest /testcontainer:\\server\path\file.dll /detail:debugtrace /detail:traceinfo From Windows 8 client, user as local administrator: command works as expected. It loads the tests and executes them. From Windows 2008 R2 Standard, user as a local administrator: command fails with the following message: Could not load file or assembly 'file://\\server\path\file.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) Further troubleshooting using 1) a mapped http://www.clearmindsoftware.com/post/Resolution-Error-Could-not-load-file-or-assembly-file5c5cserver5cpath5cfiledll-or-one-of-its-dependencies-(0x80131515) drive 2) PowerShell 3) /testcontainer parameter between quotes show that all these would also fail under Windows 2008 R2 Standard. The error “Could not load file or assembly” (0x80131515) is a catch-all error. For instance, it is also reported when the exe or dll was downloaded from an unsafe zone. This is fixed by right-clicking the assembly and choosing “Unlock” from the General tab. Sometimes the “Unlock” option won’t show, and in this case it wasn’t. Blocking is done based on a Zone Identifier alternate stream that is added to a file when it is copied from the Internet. To validate that the file is actually blocked, display this Zone Identifier using the following command (note the direction of the “<” sign – the opposite one would erase the file): more < file.dll:Zone.Identifer If ZoneId = 3 or 4, your file is blocked. In our case, the files show no alternate Zone.Identifier stream. Since copying the files locally to a folder in the Window 2008 R2 Standard server allowed MSTest to execute the tests, this showed that the issue was constrained to some security policy differences between Windows 8 and Windows 2008 R2 Standard. This also confirmed that the files were not blocked. Next step I looked into the .NET Framewo
load file or assembly or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) ★★★★★★★★★★★★★★★ BradADecember 11, 20097 0 0 0 Some folks have mentioned to me that they are https://blogs.msdn.microsoft.com/brada/2009/12/11/visual-studio-project-sample-loading-error-assembly-could-not-be-loaded-and-will-be-ignored-could-not-load-file-or-assembly-or-one-of-its-dependencies-operation-is-not-supported-exception-from/ having trouble getting some of my samples to work. And in fact, just the other day, I ran into a problem getting my own samples to work. It turns out to be a problem with the way windows treats the sample that you down load. Specifically, because you downloaded the sample from the internet, windows treats the sample as “untrusted” content. When you unzip untrusted content you get a directory full could not of untrusted content. Visual Studio is not so good and running untrusted content. Unfortunately, you get some really bad error messages like the one above. Here is the error message from VB Warning 1 Assembly ‘C:\Users\brada\Desktop\MyApp.VB\MyApp.VB.Web\bin\MyApp.VB.Web.dll' could not be loaded and will be ignored. Could not load file or assembly ‘file:///C:\Users\brada\Desktop\MyApp.VB\MyApp.VB.Web\bin\MyApp.VB.Web.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) MyApp.VB And here is the message from could not load C#: Warning 1 Assembly ‘C:\Users\brada\Desktop\MyApp.Starter\MyApp.Web\bin\MyApp.Web.dll' could not be loaded and will be ignored. Could not load file or assembly ‘file:///C:\Users\brada\Desktop\MyApp.Starter\MyApp.Web\bin\MyApp.Web.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) MyApp Notice these are warnings, so if you are only looking at errors, you will be even more confused. There is at least a good warning when the project is being loaded. I am not sure why you are giving the option to continue here, because there are very few projects that will just work in the semi-trusted way. If you see this, hit cancel and fix the issue first. Luckily fixing this is very easy. Just go back to the ZIP file you downloaded, select properties, then “unblock” the content. Then extract the contents and rerun it. Everything should work fine. Good luck! Tags RIAServices Silverlight Comments (7) Cancel reply Name * Email * Website Frymaster says: December 12, 2009 at 12:25 am minus a few points for the unintuitive error messages (the first doesn't mention it's a trust issue; the second implies continuing will fix things) plus several more points for having VS pick up on the downloaded-from-web flag 😉 Reply Jouni Heikniemi says: December 12, 2009 at 4:3