NuBuild icon indicating copy to clipboard operation
NuBuild copied to clipboard

NuBuild 1.8 only works with Visual Studio 2012 installed

Open dtewinkel opened this issue 11 years ago • 3 comments

NuBuild 1.8 only works with Visual Studio 2012 installed. I had a set-up with just VS2010 installed. NuBuild then gives the error: "C:\Program Files (x86)\MSBuild\NuBuild\v1\NuBuild.targets(51,53): error MSB4066: The attribute "KeepMetadata" in element <_SourceItemsToCopyToOutputDirectoryAlways> is unrecognized. [E:\build-output\builds\twia.validation\deployments\Twia.Validation.NuGet\Twia.Validation.NuGet.nuproj]" Installing VS2013 did not help. Installing VS2012 resolved the error. In the environment we use NuBuild we have quite a few machines still with just VS2010 installed.

dtewinkel avatar Oct 27 '13 16:10 dtewinkel

Do you know whether these machines have .NET 4.5 installed? If not, you might try installing it. This should upgrade MSBuild with support for the KeepMetadata attribute. This should be a reasonable workaround that won't require a VS upgrade.

brentspell avatar Oct 28 '13 14:10 brentspell

Unfortunately I don't know anymore, but I guess not. I first installed VS2013, but that did not seem to solve the issue. Only after installing VS2012 I could build usign NuBuild.

dtewinkel avatar Oct 28 '13 15:10 dtewinkel

We've run into this today (first VS2010 usage after VS2012 and 2013), the solution is to simply delete the KeepMetadata="CopyToOutputDirectory;TargetPath" attributes from both lines. It works under both VS2010 and VS2012. This was copied from a v4.5 MS.Common.targets file, but these are not supported in v4.0. It's my fault.

lmagyar avatar May 15 '14 20:05 lmagyar