Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 8 version conflicts with Microsoft.CodeAnalysis.VisualBasic nuget package #171

Closed
DoobieAsDave opened this issue Jan 11, 2024 · 9 comments · Fixed by #172
Closed

.NET 8 version conflicts with Microsoft.CodeAnalysis.VisualBasic nuget package #171

DoobieAsDave opened this issue Jan 11, 2024 · 9 comments · Fixed by #172

Comments

@DoobieAsDave
Copy link

We want to migrate out solution to .NET 8 and have a version conflict using ReportViewerCore.NETCore.

We discovered that ReportViewerCore.NETCore ships Microsoft.CodeAnalysis.VisualBasic 4.8.0-3 final as dependency.
Is there a reason why CodeAnalyser is delivered as dependency? Normally CodeAnalyser should not be delivered as a dependency of a nuget package.

Removing the Microsoft.CodeAnalysis.VisualBasic from the output would solve our issue. We provide a PR for this change.

@lkosson
Copy link
Owner

lkosson commented Jan 12, 2024

Microsoft.CodeAnalysis.VisualBasic is a Roslyn compiler for Visual Basic. Reporting Services / ReportViewer uses Visual Basic as a scripting language and this compiler is required for most of reports to work.

A typical ASP.NET Core project references package Microsoft.VisualStudio.Web.CodeGeneration.Design which transitively reference package Microsoft.CodeAnalysis.Common. For .NET 8 it requires version 4.8.0-3.final. To minimize dependency conflicts, ReportViewerCore also references version 4.8.0-3 final of Microsoft.CodeAnalysis.* packages.

@DoobieAsDave
Copy link
Author

Thanks for the response! We try to understand why these dependencies are shipped with the package.
Generally nuget packages should have runtime dependencies and Microsoft.CodeAnalysis* are strictly compile dependecies. We are using a different version of Microsoft.CodeAnalysis which generates undesired conflicts. At the moment we are unable to migrate and are unable to change the package.

@lkosson
Copy link
Owner

lkosson commented Jan 12, 2024

I disaggree. Microsoft.CodeAnalysis.VisualBasic is a compiler which can be used both at compile time and at runtime.

Sadly, both Microsoft.CodeAnalysis.VisualBasic and Microsoft.CodeAnalysis.CSharp have strict dependency on exact matching version of Microsoft.CodeAnalysis.Common. If your project has a transitive dependency on Microsoft.CodeAnalysis.Common, you have to resolve such version conflict manually. I won't remove dependency on Microsoft.CodeAnalysis.VisualBasic, because that would break ReportViewerCore for everyone not referencing Roslyn packages in their projects, and I don't know how to express nuget dependency to allow any (but matching) versions of Microsoft.CodeAnalysis.VisualBasic and Microsoft.CodeAnalysis.Common.

@sucharithv
Copy link

@lkosson Thank you for the package it is very useful for us as we move into .net core.

There are newer versions out there for the Microsoft.CodeAnalysis.VisualBasic, at least there is a 4.8.0 which is not a pre-release.
https://www.nuget.org/packages/Microsoft.CodeAnalysis.VisualBasic/4.9.0-2.final#versions-body-tab
Can you update the dependency to the latest non pre-release version?

Not sure if it will solve the specific version issue as even after upgrading to .net core 8.0 there are some unresolved conflicts arising from EF packages

Error NU1107 Version conflict detected for Microsoft.CodeAnalysis.Common. Install/reference Microsoft.CodeAnalysis.Common 4.8.0-3.final directly to project XXX.Api to resolve this issue. XXX.Api -> XXX.Framework.Reporting.Ssrs 1.1.0.4 -> ReportViewerCore.NETCore 15.1.19 -> Microsoft.CodeAnalysis.VisualBasic 4.8.0-3.final -> Microsoft.CodeAnalysis.Common (= 4.8.0-3.final) XXX.Api -> Microsoft.EntityFrameworkCore.Design 8.0.1 -> Microsoft.CodeAnalysis.CSharp.Workspaces 4.5.0 -> Microsoft.CodeAnalysis.Common (= 4.5.0). XXX.Api XXX.Api.csproj 1

@lkosson
Copy link
Owner

lkosson commented Jan 18, 2024

See my comment from 2024-01-12 in this thread. ReportViewerCore can reference proper release of Microsoft.CodeAnalysis.VisualBasic or almost any previous version. The reason I have chosen 4.8.0-3.final is because Microsoft decided to reference the same version by default in new ASP.NET Core web app project with scaffolding.

You can manually install newer version of Microsoft.CodeAnalysis.Common in your project and ReportViewerCore should work just fine.

@programmaticsoftware
Copy link

Hi @lkosson Thanks for this package.

I have the same issue.

Is the solution to install Microsoft.CodeAnalysis.Common manually?
Is it safe to ignore the Visual Studio warning?

See screenshots:
image
image

Thank you

@lkosson
Copy link
Owner

lkosson commented Aug 7, 2024

Either:

  • install Microsoft.CodeAnalysis.Common manually and accept the warning
  • downgrade Microsoft.VisualStudio.Web.CodeGeneration.Design to version 8.0.0
  • or remove it altogether

@programmaticsoftware
Copy link

programmaticsoftware commented Aug 7, 2024

Hi @lkosson

It looks like I don't have Microsoft.VisualStudio.Web.CodeGeneration.Design installed.
image

It's a dot-net 8 Blazor Web App.

Thank you

@lkosson
Copy link
Owner

lkosson commented Aug 7, 2024

Then perhaps some other of your packages has different version of Microsoft.CodeAnalysis.Common as a dependency. Also see #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants