question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft.CodeAnalysis incoherency in 5.0.100 SDK between 3.8.0 and Microsoft.NET.Sdk.Razor's 3.7.0

See original GitHub issue

Describe the bug

The 5.0.100 .NET SDK contains an incoherency between the “base” Roslyn version and the copy that’s redistributed by Microsoft.NET.Sdk.Razor:

  • sdk/5.0.100/Roslyn/bincore/Microsoft.CodeAnalysis.dll: version 3.8.0
  • sdk/5.0.100/Sdks/Microsoft.NET.Sdk.Razor/tools/Microsoft.CodeAnalysis.dll: version 3.7.0.

Is this something that needs to be fixed in the official build for 5.0.1 / 5.0.101 SDK? Or is this somehow intentional?

Source-build only builds one version of Roslyn: 3.8.0. Is it ok for source-build to put 3.8.0 in both places?

This started as https://github.com/dotnet/source-build/issues/1869. We need a response to make sure this doesn’t block 5.0.100 source-build.

@Pilchie /cc @JunTaoLuo @mmitche @dleeapho

To Reproduce

Download the 5.0.100 .NET SDK and examine these two DLLs with your favorite assembly version workflow. Or, follow these shell commands on Linux with PowerShell installed:

#> wget https://download.visualstudio.microsoft.com/download/pr/820db713-c9a5-466e-b72a-16f2f5ed00e2/628aa2a75f6aa270e77f4a83b3742fb8/dotnet-sdk-5.0.100-linux-x64.tar.gz
...
#> tar -xf dotnet-sdk-5.0.100-linux-x64.tar.gz
...
#> find . -iname 'Microsoft.CodeAnalysis.dll' -exec pwsh -c 'echo {}; [System.Reflection.AssemblyName]::GetAssemblyName("{}").Version.ToString()' \;
./sdk/5.0.100/Sdks/Microsoft.NET.Sdk.Razor/tools/Microsoft.CodeAnalysis.dll
3.7.0.0
./sdk/5.0.100/Roslyn/bincore/Microsoft.CodeAnalysis.dll
3.8.0.0

Further technical details

  • ASP.NET Core version: 5.0.0
  • .NET SDK version: 5.0.100

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
pranavkmcommented, Nov 24, 2020

Yup, we should be safe to update the versions here. Razor requires referencing two different versions of Roslyn

  • Razor compiler that ships as part of the SDK needs to reference the same version as the rest of the SDK
  • Razor runtime compilation is shipped as a NuGet package and needs to reference a version of Roslyn that ships as a NuGet package. Roslyn doesn’t follow the runtime ship schedule and some amount of manual work is required to keep this updated.

In the AspNetCore-Tooling repo, these used two different version numbers. When we migrated to the AspNetCore repo, these numbers got squished together. @mmitche / @dotnet/aspnet-build could you help me with the gesture required to automate version updates for the package? At least for the first bit, we should be using the newest all the time.

1reaction
pranavkmcommented, Nov 24, 2020

Yup, that’s my plan. It’s the least spooky thing to do

Read more comments on GitHub >

github_iconTop Results From Across the Web

NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
Microsoft.CodeAnalysis problem
Hello, I am receiving these suspisious waringns. Can someone help ? 1>CSC : warning CS8032: An instance of analyzer Microsoft.CodeAnalysis.
Read more >
.NET Core SDK 6.0.200: Could not load file or assembly ' ...
Describe the bug. Build fails with error: ##[error]CSC(0,0): Error CS8032: An instance of analyzer Microsoft.NET.Sdk.Razor.SourceGenerators.
Read more >
Version conflict detected for Microsoft.CodeAnalysis. ...
I want to add the FluentValidation Nuget package in my asp.net core app through Nuget Package Manager.While adding I get this error: Severity ......
Read more >
Microsoft.CodeAnalysis.Common 4.7.0
Version Downloads Last updated 4.7.0 2,627 2 days ago 4.7.0‑2.final 14,959 2 months ago 4.7.0‑1.final 32,267 3 months ago
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found