Maro_QA
Maro_QA

Reputation: 104

Does MS-Build Definition inherit property from projects?

I've some sql projects with the property "Treat Warnings as Errors" enabled for every build configuration set (Debug, Release, etc.).

Building locally this property works without problem (so every warning is managed as error).

Using instead the MSBuild-Definition tool the same warnings are not managed as errors but just as warnings.

I cannot add the MS Build Argument /p:TreatWarningsAsErrors=True to the Build level because in the same build definition there are other projects (not only sql projects) where the property "Treat Warnings as Errors" isn't enabled, so every build is going to fail.

What I want is to have the possibility to set my Build definition so that they can manage some project as "TreatWarningsAsErrors" and some other not.

I read in some documents that the build definition should inherit its property from the project built.

Is this wrong? Should I just add some configuration to my Build Process Template?

I am using the TfvcTemplate.12.xaml

If you need some other details just ask me.

Hope you can help me

Thanks

Upvotes: 0

Views: 85

Answers (1)

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31075

I have tested in my VS 2015.3 + TFS 2015.3, and used XAML Build with default build process template TfvcTemplate.12.xaml, but couldn't reproduce your issue.

If I enable "Treat Warnings as Errors" for one project in a solution, I would get an error for XAML build. If I disable this option, there is no error but warning in XAML build:

enter image description here

enter image description here

Please compare your environment with mine, and double check whether you have checked in your solution after you enable the "Treat Warnings as Errors" option.

Upvotes: 0

Related Questions