Lionel Koh
Lionel Koh

Reputation: 79

Unknown Assembly error thrown by Jenkins

I have a unit test project coded in vb.net using entity framework. When I run my unit tests on visual studio everything runs fine. When I try to deploy my unit test on jenkins, I get the following error.

Run has the following issue(s):
Warning: Test Run deployment issue: The assembly or module 'Microsoft.Practices.ServiceLocation' directly or indirectly referenced by the test container 'C:\Program Files\Jenkins\workspace\upstreambatchtests\bin\debug\upstreambatchtests.dll' was not found.

I have no idea what this microsoft.practices.servicelocation is as my application does not have a reference to it. Appreciate if someone could shed some light on it.

Below is my jenkins config

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:MessageManagementLayer\UpstreamBatch\UpstreamBatchTests\bin\Debug\UpstreamBatchTests.dll /test:UpstreamBatchTests /resultsfile:UpstreamBatchTestsResults.trx 

Upvotes: 2

Views: 788

Answers (1)

faby
faby

Reputation: 7556

The assemblies that aren't used in test won't be copied to test folder. So you have two options

  1. Add a decorator to your test method [DeploymentItem("MissingDll.dll")] where MissingDll is the dll that the compiler is requesting you.

  2. install the dll file in the GAC of your machine where the code is running

in your case the missing dll is Microsoft.Practices.ServiceLocation.dll

so your decorator should be [DeploymentItem("Microsoft.Practices.ServiceLocation.dll")]

Upvotes: 2

Related Questions