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.Razor` has Apparent Invalid Dependency

See original GitHub issue

Describe the bug

Microsoft.CodeAnalysis.Razor on NuGet lists the following as dependencies:

Microsoft.CodeAnalysis.Common (>= 4.0.0-2.21354.7)
Microsoft.CodeAnalysis.CSharp (>= 4.0.0-2.21354.7)

However, the posted versions on NuGet are: Microsoft.CodeAnalysis.CSharp: 4.0.0-2.final Microsoft.CodeAnalysis.Common: 4.0.0-2.final

To Reproduce

Attempt to install a NuGet package that depends on Microsoft.CodeAnalysis.Razor.

Exceptions (if any)

The following message displays in the error list:

Severity	Code	Description	Project	File	Line	Suppression State
Error	NU1102	Unable to find package Microsoft.CodeAnalysis.CSharp with version (>= 4.0.0-3.21370.20)
  - Found 116 version(s) in nuget.org [ Nearest version: 4.0.0-2.final ]
  - Found 0 version(s) in Microsoft Visual Studio Offline Packages

Additional outputs:

33> ... : warning NU1603: Microsoft.CodeAnalysis.Razor 6.0.0-preview.7.21378.6 depends on Microsoft.CodeAnalysis.Common (>= 4.0.0-2.21354.7) but Microsoft.CodeAnalysis.Common 4.0.0-2.21354.7 was not found. An approximate best match of Microsoft.CodeAnalysis.Common 4.0.0-2.final was resolved.
33> ... : warning NU1603: Microsoft.VisualStudio.Web.CodeGeneration 6.0.0-preview.7.21406.1 depends on System.Collections.Immutable (>= 6.0.0-preview.7.21377.12) but System.Collections.Immutable 6.0.0-preview.7.21377.12 was not found. An approximate best match of System.Collections.Immutable 6.0.0-preview.7.21377.19 was resolved.

33> error NU1102: Unable to find package Microsoft.CodeAnalysis.CSharp.Workspaces with version (>= 4.0.0-3.21370.20)
33> error NU1102:   - Found 116 version(s) in nuget.org [ Nearest version: 4.0.0-2.final ]
33> error NU1102:   - Found 0 version(s) in Microsoft Visual Studio Offline Packages
33> error NU1102: Unable to find package Microsoft.CodeAnalysis.CSharp with version (>= 4.0.0-3.21370.20)
33> error NU1102:   - Found 116 version(s) in nuget.org [ Nearest version: 4.0.0-2.final ]
33> error NU1102:   - Found 0 version(s) in Microsoft Visual Studio Offline Packages

Further technical details

  • The IDE (VS / VS Code/ VS4Mac) you’re running on, and its version Visual Studio 2022 Preview 3.0

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
JoeRobichcommented, Aug 13, 2021

4.0.0-2.21354.7 packages have been published to NuGet.org

1reaction
bfrencommented, Aug 13, 2021

This is still an issue, but with different analysis packages (.Common and .CSharp):

Warning	NU1603	Microsoft.CodeAnalysis.Razor 6.0.0-preview.7.21378.6 depends on Microsoft.CodeAnalysis.Common (>= 4.0.0-2.21354.7) but Microsoft.CodeAnalysis.Common 4.0.0-2.21354.7 was not found. An approximate best match of Microsoft.CodeAnalysis.Common 4.0.0-2.final was resolved.
Warning	NU1603	Microsoft.CodeAnalysis.Razor 6.0.0-preview.7.21378.6 depends on Microsoft.CodeAnalysis.CSharp (>= 4.0.0-2.21354.7) but Microsoft.CodeAnalysis.CSharp 4.0.0-2.21354.7 was not found. An approximate best match of Microsoft.CodeAnalysis.CSharp 4.0.0-2.final was resolved.

Latest posted versions of those are both 4.0.0-3.final.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Blazor Server project keeps throwing internal errors when ...
Blazor Server project keeps throwing internal errors when adding new code. If I close them and keep adding my code they come back...
Read more >
Could not load file or assembly Microsoft.CodeAnalysis
Right click on your project >> Manage Nuget packages manager for solution >> Tap on Updates >> Update your 'Microsoft.
Read more >
Solution to Visual Studio 2022 messing up ...
NET 5 and .NET Standard 2 projects couldn't be loaded anymore in Visual Studio 2019. The error shown when attempting to load the...
Read more >
Runtime C# Code Compilation Revisited for Roslyn - Rick Strahl
Compilation requires that each and every dependency that your code references has to available to the compiler. This means both explicit ...
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