Skip to content

Commit cbefade

Browse files
Copilotatifaziz
andcommitted
Fix duplicate source generator loading by using versioned roslyn3.10/ analyzer path
Co-authored-by: atifaziz <20511+atifaziz@users.noreply.github.com>
1 parent 924ba4d commit cbefade

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/DocoptNet/DocoptNet.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ Portions Copyright (C) West Wind Technologies, 2008.
7373
</ItemGroup>
7474

7575
<ItemGroup>
76-
<!-- Package the generator in the analyzer directory of the nuget package -->
77-
<None Include="$(OutputPath)\netstandard2.0\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
76+
<!-- Package the generator in the analyzer directory of the nuget package.
77+
Using a versioned roslyn3.10/ folder instead of the unversioned cs/ path ensures the SDK
78+
selects only the best-matching Roslyn variant (3.10 baseline or 4.4) rather than loading both.
79+
See: https://github.com/dotnet/sdk/issues/20355 -->
80+
<None Include="$(OutputPath)\netstandard2.0\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/roslyn3.10/cs" Visible="false" />
7881
<!-- Package the Roslyn 4.4 variant of the generator -->
7982
<None Include="$(_Roslyn44AnalyzerDir)$(Configuration)/netstandard2.0/$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/roslyn4.4/cs" Visible="false" />
8083
<!--

0 commit comments

Comments
 (0)