George Hernando
George Hernando

Reputation: 2650

Visual Studio MSBuild errors

I installed Visual Studio 2013. Previously my project was built in VS 2010.

I opened my project in VS 2013 and the project was automatically updated. I've also updated the project build options to use .Net 4.5.3 instead of 4.0.

The project builds and runs with no errors. But I see more than 100 warnings that I haven't seen before -- all related to the file Microsoft.Common.CurrentVersion.target.

The first warning, for example is:

The 'TreatAsLocalProperty' attribute is not declared.

I'm not familiar with the Microsoft.Common.CurrentVersion.target file. When I examine the warnings, I see that this file is coming from msbuild\12.0\bin directory.

I see that I also have an msbuild\14.0\bin directory, although the file there looks very similar. I think maybe this was installed as part of the VS 2013 install -- maybe I should be using that version of msbuild(?) -- but I am not sure where to change that and also not sure that would fix the problem. I changed my .csproj file to reference version 14:

<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

But that had no effect.

Maybe there is something else that needs to be included in the project?

Upvotes: 6

Views: 4271

Answers (1)

Opus4210
Opus4210

Reputation: 93

This link helped me microsoftcommontargets errors and over a hundred warnings. The answer by Cool Coyote did the trick:

I had this error appear 1 day after rearranging a large project. I finally solved the problem by closing down every source window. I had been veiwing references in my project and had a fair few windows open. When everything was closed I tried a run , which built and run ok to my surpise with absolutely no warnings. I find the environment does get corrupt now and then, usually a restart does the trick but in this case thr problem just repeated. Cleaning the ide by closing the window takes the memeory load of the ide, Im suspicious of internal corruptions when this sort of thing happens.

So I closed all the source windows, did a Solution > Clean, and a Solution > Rebuild...and no more of those warnings!

Upvotes: 9

Related Questions