Hudson : warning MSB3245: Could not locate the assembly "nunit.framework"
Asked Answered
P

3

6

I'm working in a Virtual Machine as a Hudson Slave. In the virtual machine, I add the path to the MSBuild I want to use :

%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\;

I added also the path to NUnit :

C:\Program Files\NUnit 2.5.7\bin\net-2.0;

And so, I can run the NUnit and MSBuild command lines in my VM.

But I get this error when my Hudson Job build my solution :

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.framework".

What should I fix in my VM or in Hudson? Thank you a lot!

EDIT

Here how the concerned file *.csproj references to the dll :

<Reference Include="nunit.framework, Version=2.5.7.10213, Culture=neutral, PublicKeyToken=KKKKKKKKKK processorArchitecture=KKK">
    <SpecificVersion>False</SpecificVersion>
    <HintPath>Dll\nunit.framework.dll</HintPath>
</Reference>
Potable answered 6/12, 2013 at 15:26 Comment(0)
T
14

The issue isn't the nunit-console.exe (or whatever the name).

The issue is that you cannot find nunit.framework.dll...as a reference in your project file (.csproj for C#).

Your unit-test project, you need to open it and find how/where the reference to the nunit.framwork.dll is wired.

Post the .csproj code if that is confusing.

EDIT:

<HintPath>Dll\nunit.framework.dll</HintPath>

The issue is that you need to "download" or copy or svn-export or svn-checkout or nuget-get that file. And place it in the relative directory to your .csproj.

Because you have specified a HintPath, it will NOT find the one in this below directory:

C:\Program Files (x86)\NUnit 2.X.Y\bin\nunit.framework.dll

Basically, the HintPath says "I expect to find this file HERE", and your MSBUILD error says "I did not find it where the HintPath said it would be."

Terminator answered 6/12, 2013 at 20:35 Comment(4)
The project is very well coded. I built the solution according to each configuration (AnyCPU,Win32,x64) by Visual Studio 2008 graphically and it was generated successfuly. But when I build it remotely from Hudson, it fails to find the reference to that dllPotable
Post your csproj code (open it in notepad). .. and post the section that has the nunit reference.Terminator
Could not get it to work without hint path i just hardcoded default nunit install path: <HintPath>C:\Program Files (x86)\NUnit 2.6.3\bin\nunit.framework.dll</HintPath>Sidesaddle
The Identity that runs the build-process.......must have access to that directory. And giving the Identity that runs the build-process......permissions to "c:\program files\" (or similar) is not a best practice IMHO.Terminator
D
1

Under which user account does jenkins-slave.exe (or hudson slave) run on your VM node?

Paths to .NET dlls are registered in windows registries (HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\VersionMinimum\AssemblyFoldersEx\MyAssemblies]@="AssemblyLocation").

By default jenkins runs jenkins-slave service under NT AUTHORITY\SYSTEM account (who probably doesn't have any AssemblyLocations registered on your system).

I filled my user acount login (under which the .csproj builds like a charm) details into jenkins -> nodes -> VM -> config and additionally set that same user account under which Windows runs the "jenkins slave" service (in VM's Windows Services -> jekins slave -> properties -> Log on -> This account: ...)

So it's working without specifying hint path in .csproj, because it is machine specific (my builds are running on multiple machines).

Daughterly answered 13/11, 2014 at 12:57 Comment(0)
P
0

In my case, the issue was in the build sequence. Required libs were configured to build after the failed one.

Proliferate answered 27/4, 2020 at 18:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.