Version Conflict with AR16 in dotnet 6 MVC application

Posted by: chris.eaton on 7 April 2022, 4:54 am EST

    • Post Options:
    • Link

    Posted 7 April 2022, 4:54 am EST

    Hi. I’m trying to use AR 16 in my ASP.net 6 application and getting version conflicts as shown:

    Version conflict detected for Microsoft.CodeAnalysis.CSharp. Install/reference Microsoft.CodeAnalysis.CSharp 4.0.0 directly to project MyProject.Website.External to resolve this issue.

    MyProject.Website.External → Microsoft.VisualStudio.Web.CodeGeneration.Design 6.0.1 → Microsoft.VisualStudio.Web.CodeGenerators.Mvc 6.0.1 → Microsoft.VisualStudio.Web.CodeGeneration 6.0.1 → Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 6.0.1 → Microsoft.VisualStudio.Web.CodeGeneration.Core 6.0.1 → Microsoft.VisualStudio.Web.CodeGeneration.Templating 6.0.1 → Microsoft.CodeAnalysis.CSharp (>= 4.0.0)

    MyProject.Website.External → MyProject.Documents → GrapeCity.ActiveReports 16.0.2 → GrapeCity.ActiveReports.Core.Scripting 3.0.2 → Microsoft.CodeAnalysis.Compilers 3.9.0 → Microsoft.CodeAnalysis.CSharp (= 3.9.0). MyProject.Website.External

    Installing Microsoft.Codeanalysis.CSharp 4.0.0 isn’t a fix because it won’t install due to AR specifically wanting 3.9.0.

    Any tips on how to get past this? It’s a big stumbling block since Microsoft’s tools are all using >=4.0.0 and I can’t see how to get both to play nice at the same time.

  • Posted 7 April 2022, 10:57 pm EST

    Hi Chris,

    Thanks for the detailed information of your query. I have escalated this issue to the development team and will revert back to you once I have any information from them.[AR-28586]

    Regards,

    Akshay

  • Posted 21 April 2022, 4:26 am EST

    We ended up having to do a separate library in order to make things work.

    We have also had constant issues with nuget updates. What to update and what to leave alone is not clear and creates a huge time suck if you accidentally upgrade everything and that have to try to roll it all back. No clear documentation on this.

    We also have similar conflicts only with DPI awareness lib. This is constant with every project in .Net v5 and greater:

    reporting.csproj: [NU1701]

    Package ‘Microsoft.VisualStudio.DpiAwareness 6.1.28916’ was restored using ‘.NETFramework,Version=v4.8’ instead of the project target framework ‘net5.0’.

    This package may not be fully compatible with your project.

    I can not share code as it is not mine to share but I do believe this is probably and ongoing issue with ActiveReports so this and the post above are not unique.

    Thanks

  • Posted 21 April 2022, 4:42 am EST

    Can confirm what Tab stated; dotnet Core has forced us to create a separate class library to hold the AR processes for basically all of our projects in order to isolate the NuGet package reference conflicts.

  • Posted 21 April 2022, 9:42 pm EST

    Hello,

    I understand you concern and have shared this information with the development team. I will get back to you once I have any updates on the case.

    For now regarding the NuGet Package compatibility issue I would suggest you to just ignore the NuGet warning[NU1701].

  • Posted 9 June 2022, 4:18 pm EST

    Hello,

    >> Any tips on how to get past this?

    We have updated the references for ActiveReports 16.1. You should be able to install Microsoft.Codeanalysis.CSharp 4.0.0. To take advantage of the latest bug fixes, please upgrade ActiveReports.

    >> We also have similar conflicts only with DPI awareness lib.

    We have fixed a lot of dependencies for ActiveReports 16 packages in the latest version. The Microsoft.VisualStudio.DpiAwareness shouldn’t be added automatically in your .Net Core project anymore.

    >> dotnet Core has forced us to create a separate class library to hold the AR processes for basically all of our projects in order to isolate the NuGet package reference conflicts.

    This seems to be a valid approach to handle these issues as using ActiveReports packages in your project does add a lot of NuGet packages as dependencies in your project. There can be many circumstances where some NuGet packages can throw version conflict errors. Isolating NuGet packages in a class library seems to be a very practical way of handling such issues.

  • Posted 13 June 2022, 10:36 am EST

    Can confirm; 16.1 is better at reducing dependencies.

  • Posted 27 December 2022, 3:10 am EST - Updated 27 December 2022, 3:38 am EST

    I’m having a similar issue.

    Active Reports is requiring CodeAnalysis.CSharp == 4.0.1

    Another package I need is requiring CodeAnalysis.CSharp == 4.3.1

    Is it possible to have ActiveReports Require >= 4.0.1?

  • Posted 27 December 2022, 4:32 pm EST

    Hi Nick,

    It seems that you are using an older version of ActiveReports as I tested this issue out with the latest version of ActiveReports i.e. ActiveReports 16.3.2. Using ActiveReports 16.3.2, you should be able to upgrade the Microsoft.CodeAnalysis.Compilers and Microsoft.CodeAnalysis.CSharp package to the latest stable version i.e. v4.4.0.

    You may use the following link to download the latest version of ActiveReports: Download ActiveReports

  • Posted 28 December 2022, 5:30 am EST

    I upgraded to 16.3.2 and am still having the issue.

    It seems this package is being transitively included by GrapeCity.ActiveReports

    GrapeCity.ActiveReports.Core.Scripting 3.4.2

    This Core.Scripting package seems to be the one requiring 4.0.1 of the Microsoft packages

  • Posted 28 December 2022, 5:34 am EST

    Got it working.

    I was trying to add Microsoft.CodeAnalysis.CSharp 4.3.1 and getting an error.

    Adding Microsoft.CodeAnalysis.Compilers 4.3.1 instead cleared up the issues.

  • Posted 28 December 2022, 3:39 pm EST

    Hi Nick,

    Glad to know your issue is resolved!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels