Skip to content

Commit 4ac9854

Browse files
authored
Merge pull request #24130 from dotnet/prkrishn/pin-compiler-version
Pin the compiler version in RSG to an exact version
2 parents f36c51b + 8f6f0d0 commit 4ac9854

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

eng/Versions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
<PropertyGroup Label="Manually updated">
154154
<!-- Dependencies from https://github.com/microsoft/MSBuildLocator -->
155155
<MicrosoftBuildLocatorPackageVersion>1.4.1</MicrosoftBuildLocatorPackageVersion>
156+
<MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>4.0.1</MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>
156157
</PropertyGroup>
157158
<PropertyGroup>
158159
<!-- Dependencies from https://github.com/dotnet/xliff-tasks -->

src/RazorSdk/SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@
1111
<Nullable>enable</Nullable>
1212
</PropertyGroup>
1313

14+
<PropertyGroup>
15+
<!-- Use a pinned version of the compiler unless building from source. This avoids issues where the source generator is unable to launch in VS because the compiler versions is older than the one in the SDK. -->
16+
<RSG_MicrosoftCodeAnalysisCSharpPackageVersion Condition="'$(DotNetBuildFromSource)' != 'true'">$(MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion)</RSG_MicrosoftCodeAnalysisCSharpPackageVersion>
17+
<RSG_MicrosoftCodeAnalysisCSharpPackageVersion Condition="'$(DotNetBuildFromSource)' == 'true'">$(MicrosoftCodeAnalysisCSharpPackageVersion)</RSG_MicrosoftCodeAnalysisCSharpPackageVersion>
18+
</PropertyGroup>
19+
1420
<ItemGroup>
15-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisCSharpPackageVersion)" />
21+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(RSG_MicrosoftCodeAnalysisCSharpPackageVersion)" />
1622
<PackageReference Include="Microsoft.AspNetCore.Razor.SourceGenerator.Tooling.Internal" Version="$(MicrosoftAspNetCoreRazorSourceGeneratorToolingInternalPackageVersion)" GeneratePathProperty="true" />
1723
</ItemGroup>
1824

0 commit comments

Comments
 (0)