Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StyleCopTask couldn't be load on Hudson Server

I'm trying to set up our Hundson Server for CI our new project. Everything runs fine, building the project, unit testing and FxCop checks runs. But when I try to check the code with StyleCop an error occurs. First: We develop in C# with MS VS 2010 and on the Hudson Server there is the .Net 4.0 and the Windows SDK 7.1 installed.

Now I've added the StyleCop.Targets to my SVN and linked the .cproj files to the file. If I build in VS2010 everythin went fine, except of the StyleCop warnings, but if the Hundson Server tries to build the project this error occurs:

error MSB4062: The "StyleCopTask" task could not be loaded from the assembly 
C:\Program Files (x86)\MSBuild\..\StyleCop 4.7\StyleCop.dll. Could not load file or
assembly 'Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot 
find the file specified. Confirm that the <UsingTask> declaration is correct, 
that the assembly and all its dependencies are available, and that the task 
contains a public class that implements Microsoft.Build.Framework.ITask. 

The StyleCop.dll is in the path on the Hundson Server, can someone tell me what I've done wrong?

like image 862
CoolKiffings Avatar asked Sep 04 '12 09:09

CoolKiffings


1 Answers

  1. Go to Control Panel\Programs\Programs and Features
  2. Select Turn Windows features on or off
  3. Click the .NET Framework 3.5 (includes .NET 2.0 and 3.0)
  4. Click OK and wait
  5. Restart Visual Studio

That should fix it

like image 196
George Bushy Tail Avatar answered Oct 04 '22 20:10

George Bushy Tail