dotnet / dotnet/msbuild

Assign-once properties

Open
#1,673 5 comments 7 reactions 0 assignees View on GitHub
Area: Language triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

Some properties define things that should logically be constant throughout a project, but MSBuild doesn't provide any way to enforce that they're not modified after they've been read.

Take `BaseIntermediateOutputPath`, for example. Since it's a foundational property, it's read early in SDK .props to set other properties. But that means that it can't just be set in the user's `.csproj`, like most properties--because that's after decisions have already been made according to its earlier value.

If there was a way to specify that any write to a given property after it had been read was an authoring error, this could be much easier to chase down.

The error shouldn't fire for things that are attempting to set defaults like

```xml

DefaultValue


```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.