Portable Class Library Projects and your Build Server
Yesterday my build server started failing on a particular project and after a quick look at the log I found that it simply wasn't building the solution. Peculiar as I knew it built fine on several development machines, however I dug into the logs and found the following:
However when attempting to install I got a great message saying I needed VS2010 and SP1 installed, obviously for a build server this wasn't going to happen. After a bit of digging on MSDN I found that the installer actually has a switch that when used just installs the targets for MSBuild.
Simply run the installer with the /BuildMachine switch and everything installs hunky dory.
To my great relief the build server started building again and things went back to normal.
- error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Portable\v4.0\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
However when attempting to install I got a great message saying I needed VS2010 and SP1 installed, obviously for a build server this wasn't going to happen. After a bit of digging on MSDN I found that the installer actually has a switch that when used just installs the targets for MSBuild.
To install the Portable Class Library Tools on a build machine without installing Visual Studio 2010, save the download file (PortableLibraryTools.exe) on your computer, and run the installation program from a Command Prompt window. Include the /buildmachine switch on the command line.
Simply run the installer with the /BuildMachine switch and everything installs hunky dory.
PortableLibraryTools.exe /buildmachine
To my great relief the build server started building again and things went back to normal.
Thanks. This solved that particular mystery for me today.
ReplyDeleteAwesome! ...and still relevant with Visual Studio 2013 and .NET 4.5
ReplyDeleteThanks!!.. you saved me lots of minutes!
ReplyDeleteI was going in circles and this tip saved me. Thanks a lot
ReplyDeleteThanx..it worked..
ReplyDeleteYears passed and this issue happened to me!
ReplyDelete