Error Loading Unable To Load The Test Container
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
Unable To Load The Test Container 64 Bit
more about Stack Overflow the company Business Learn more about hiring developers or unable to load the test container or one of its dependencies posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community test run will use dll(s) built for framework framework45 and platform x86 Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error loading some.dll: Unable to load the test container 'e:\some.dll'
Mstest Unable To Load Test Container
or one of its dependencies up vote 3 down vote favorite I have a VS2010 C# project, that references a large set of native .dll's (a commercial java runtime). These file are referenced as 'Content' files in the project, since the need to be copied with the project. The code in these libraries is called using PInvoke, there is no assembly reference. Every time I compile the solution,
Mstest Unable To Load The Test Container Or One Of Its Dependencies
the Visual Studio testing framework tries to load all the referenced dll files, expecting to find .net assemblies which may contain unit tests. Since the are no .net assemblies, the following exception is thrown: Error loading some.dll: Unable to load the test container 'e:\some.dll' or one of its dependencies. If you build your test project assembly as a 64 bit assembly, it cannot be loaded. When you build your test project assembly, select "Any CPU" for the platform. To run your tests in 64 bit mode on a 64 bit processor, you must change your test settings in the Hosts tab to run your tests in a 32 bit process. Error details: Could not load file or assembly 'file:///e:\some.dll' or one of its dependencies. The module was expected to contain an assembly manifest. This takes a whole lot of time, and I would like to tell Visual Studio to not try to load these files. How can I tell Visual Studio to stop trying to load these files? visual-studio-2010 pinvoke mstest share|improve this question edited Dec 21 '12 at 14:03 Ivaylo Slavov 4,64763384 asked Nov 29 '12 at 15:49 oɔɯǝɹ 4,09343655 add a comment| 4 Answers 4 active oldest votes up
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings mstest the module was expected to contain an assembly manifest and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges 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. Join them; it http://stackoverflow.com/questions/13629470/error-loading-some-dll-unable-to-load-the-test-container-e-some-dll-or-one-o only takes a minute: Sign up MSTest: `Unable to load test container` error if nested classes are used in test assembly up vote 0 down vote favorite Depending on the fact we include one file *.CS in our test assembly or not we get this strange error: Unable to load the test container 'UnitTesting.dll' or one of its dependencies. Error http://stackoverflow.com/questions/20069333/mstest-unable-to-load-test-container-error-if-nested-classes-are-used-in-test details: System.BadImageFormatException: Could not load file or assembly x64.Test, Version=7.0.25.0, Culture=neutral, PublicKeyToken=5385d83d2fb4d7d9' or one of its dependencies. An attempt was made to load a program with an incorrect format. The error refers to BadImageFormatException, something that cannot be issued after adding/removing a *.CS file that contains some unit tests. After cutting down the critical *.CS file to identify the problematic code, I discovered that the problem is the definition of nested classes. All the *.CS files in the test assembly project without nested classes work like a charm. Why should I avoid to use nested classes in test assemblies? c# .net unit-testing mstest share|improve this question edited Nov 19 '13 at 11:20 Andrii Kalytiiuk 1,3981123 asked Nov 19 '13 at 10:44 Alberto 3,00273183 Looks very muck like you have encountered a defect of MS product - you can submit it to MS Connect website. –Andrii Kalytiiuk Nov 19 '13 at 11:19 I can't believe I'm the only one. –Alberto Nov 19 '13 at 15:57 Problems might by in how your nested cl
“Could not find assembly” Error in Command-line MSTest Execution One of my tasks today is to get continuous integration running on a Jenkins server. It didn’t take too long to wrestle MSBuild https://www.10thmagnitude.com/could-not-find-assembly-error-in-command-line-mstest-execution/ to the ground and get the build working properly, but when I added an MSTest task, a bunch of unit tests failed with this error: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. The System.Web.Providers assembly is properly referenced in the unit test project (it's unable to part of a NuGet package), and the assembly's Copy Local property is set to True. When the unit tests run from inside Visual Studio 2013, they all work. When ReSharper runs them, they all work. But when I execute the command line: MSTest.exe /resultsfile:MSTestResults.trx /testcontainer:My.Stupid.Test\bin\My.Stupid.Test.dll /test:MyFailingTest …it fails with the error I noted above. I'll spare you the detective work, because unable to load I have to get back to work, but I did find the solution. I marked the failing test with aDeploymentItemAttribute: [TestMethod] [DeploymentItem("System.Web.Providers.dll")] public void MyFailingTest() { try { DoSomeTestyThings(); } finally { CleanUp(); } } Now, suddenly, the command line works. It's a total hack, of course, but sometimes we do these things. Except now, ReSharper is failing to run the tests. So now it takes some digging. Again, cutting out the 90 minutes of infuriating debugging, the code above didn't actually solve the problem. It turned out that MSBuild simply didn't know it had to pull in the System.Web.Providers assembly from somewhere. Fortunately, this guy suggested a way to do it. I created a new file called AssemblyInit that looks like this: using System.Diagnostics; using System.Web.Providers; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace MyApp { public class AssemblyInit { [AssemblyInitialize] public void Initialize() { Trace.WriteLine("Initializing System.Web.Providers"); var dummy = new DefaultMembershipProvider(); Trace.WriteLine(string.Format("Instantiated {0}", dummy)); } } } That does nothing more than create a hard reference to System.Web.Providers, causing MSBuild to