Version Conflict with AR16 in dotnet 6 MVC application

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

  • 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.
  • Replied 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
  • Replied 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
  • Replied 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.
  • Replied 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].
  • Marked as Answer

    Replied 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.








  • Replied 13 June 2022, 10:36 am EST

    Can confirm; 16.1 is better at reducing dependencies.
Need extra support?

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

Learn More

Forum Channels