Skip to content

Commit

Permalink
fix - bkp - Fixed bogus attribute error when Hot...
Browse files Browse the repository at this point in the history
...Reload'ing

---

Visual Studio 2022, if you have a project that has Source Link and you attempt to make an edit to any of the kernel code as you debug it without rebuilding it, will go berserk with an error message that says to the effect of:

<PROJECT>.AssemlyInfo.cs (line xx): error ENC0003: Updating 'attribute' requires restarting the application.

as per issue dotnet/sdk#36666. If we've attempted to manually set <EnableSourceControlManagerQueries>true</EnableSourceControlManagerQueries> in the Directory.Build.props that define global properties of all the projects in a solution, the issue is fixed. This issue is not fixed yet when omitting this property.

Investigating this further in the https://github.com/dotnet/sourcelink/blob/main/src/SourceLink.Common/build/Microsoft.SourceLink.Common.props file, we've found something interesting. This property list file contains this line:

<EnableSourceControlManagerQueries Condition="'$(EnableSourceControlManagerQueries)' == ''">true</EnableSourceControlManagerQueries>

For some reason, this property is not being set, causing all sorts of 'attribute' update errors, despite being implicitly set to true in case this property doesn't exist.

---

Type: fix
Breaking: False
Doc Required: False
Backport Required: True
Part: 1/1
  • Loading branch information
AptiviCEO committed Sep 10, 2024
1 parent fc08ed7 commit ad73d92
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<SignAssembly>True</SignAssembly>
<Nullable>enable</Nullable>
<WarningsAsErrors>CS9057,CS8002,nullable</WarningsAsErrors>
<EnableSourceControlManagerQueries>true</EnableSourceControlManagerQueries>
<RootPath>$(MSBuildThisFileDirectory)</RootPath>
<AssemblyOriginatorKeyFile>$(RootPath)\aptivi_snk.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand Down

0 comments on commit ad73d92

Please sign in to comment.