Skip to content

Commit 97b7677

Browse files
authored
fix(sdk): add analyzer reference for source generators (#5)
MSBuild SDK packages don't automatically include analyzers - they need to be explicitly referenced. Add Analyzer item to include the generators DLL from the package.
1 parent e14dcf9 commit 97b7677

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/CodingWithCalvin.VsixSdk/Sdk/Sdk.Vsix.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
VSIX-specific properties. Can be imported standalone or as part of the full SDK.
66
-->
77

8+
<!--
9+
Include source generators from the SDK package.
10+
The analyzers folder is at the package root, parallel to the Sdk folder.
11+
-->
12+
<ItemGroup>
13+
<Analyzer Include="$(MSBuildThisFileDirectory)..\analyzers\dotnet\cs\CodingWithCalvin.VsixSdk.Generators.dll"
14+
Condition="Exists('$(MSBuildThisFileDirectory)..\analyzers\dotnet\cs\CodingWithCalvin.VsixSdk.Generators.dll')" />
15+
</ItemGroup>
16+
817
<PropertyGroup>
918
<!-- Identify that this SDK is in use -->
1019
<UsingCodingWithCalvinVsixSdk>true</UsingCodingWithCalvinVsixSdk>

0 commit comments

Comments
 (0)