Msbuild: Consider logging reading a property that was not defined

Created on 17 Apr 2020  路  1Comment  路  Source: dotnet/msbuild

I mistyped a property name and MSBuild silently returned an empty string. There was no mention of the mistyped property name anywhere in the log.

Should we consider logging a message when a property that wasn't defined anywhere is read?

Some of these would be legit, people often leave escape hatches without any definitions, so adding a warning will break all those places. But I'm thinking a message? Would it be too noisy?

Debuggability Needs Design

Most helpful comment

We have this behind the flag MSBUILDWARNONUNINITIALIZEDPROPERTY, and see uses of

https://github.com/microsoft/msbuild/blob/73c84c6bd9cf8a73d7d5c9caae65771293ad01ea/src/Build/Evaluation/Expander.cs#L4885-L4888

I think the last time it was considered it was deemed too chatty. But worth reevaluating.

>All comments

We have this behind the flag MSBUILDWARNONUNINITIALIZEDPROPERTY, and see uses of

https://github.com/microsoft/msbuild/blob/73c84c6bd9cf8a73d7d5c9caae65771293ad01ea/src/Build/Evaluation/Expander.cs#L4885-L4888

I think the last time it was considered it was deemed too chatty. But worth reevaluating.

Was this page helpful?
0 / 5 - 0 ratings