1

Closed

Unit test fail on build server when map use external dll.

description

My unit test cases are failing on build server when map is referring external DLL. As dll is not GACed to build server it is not able able to load when map executes.

Test method xxx.TestRace threw exception:
System.IO.FileNotFoundException: Could not load file or assembly xxx.BusinessComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ght8987525a0a6a85' or one of its dependencies. The system cannot find the file specified.Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\QTAgent32.exe
Closed Apr 18, 2014 at 12:14 PM by dm_denheijer

comments

Amolp679 wrote Apr 17, 2014 at 7:02 PM

Found the solution by added a dummy unit test in my project that references one of the classes present in external dll I am refereing in the map .

[TestMethod]
    public void TestDummy()
    {

        Assert.AreEqual([DLL name].Unittest(), [DLLNAme].Unittest());
    }

dm_denheijer wrote Apr 18, 2014 at 12:13 PM

You could also add the external dll as a deployment item either in your test or in your test configuration. In case of a test configuration, you'll need to reference the test configuration in your TFS build template.

BTW, this is not a MTF problem. The problem is caused by the MSTest.exe commandline application, which only deploys referenced assemblies to the test directory.

wrote Apr 18, 2014 at 12:14 PM

wrote Apr 18, 2014 at 12:14 PM