AuthPermissions.AspNetCore icon indicating copy to clipboard operation
AuthPermissions.AspNetCore copied to clipboard

Version conflict detected for Microsoft.CodeAnalysis.Common. Install/reference Microsoft.CodeAnalysis.Common 4.8.0 directly

Open raulidavid opened this issue 1 year ago • 6 comments

NU1107: Version conflict detected for Microsoft.CodeAnalysis.Common. Install/reference Microsoft.CodeAnalysis.Common 4.8.0 directly to project Jiban.Application to resolve this issue. Jiban.Application -> RazorEngineCore 2024.4.1 -> Microsoft.CodeAnalysis.CSharp 4.8.0 -> Microsoft.CodeAnalysis.Common (= 4.8.0) Jiban.Application -> Jiban.Infrastructure -> AuthPermissions.AspNetCore 8.0.0 -> Microsoft.EntityFrameworkCore.Tools 8.0.2 -> Microsoft.EntityFrameworkCore.Design 8.0.2 -> Microsoft.CodeAnalysis.CSharp.Workspaces 4.5.0 -> Microsoft.CodeAnalysis.Common (= 4.5.0).

raulidavid avatar May 28 '24 03:05 raulidavid

Please @JonPSmith review this issue

raulidavid avatar May 28 '24 03:05 raulidavid

Hi @raulidavid,

Are you using the latest version, AuthP version 8.0.0, which I released yesterday or an older version. The older version supported .NET 6, 7 and 8 and had some problems with Microsoft.CodeAnalysis... . Version 8.0.0 only supports .NET 8 and should be better, but maybe I missed something.

Let me know.

JonPSmith avatar May 28 '24 08:05 JonPSmith

I am using the latest AuthP version 8.0.0

raulidavid avatar May 28 '24 10:05 raulidavid

Your error shows a difference of the Microsoft.CodeAnalysis.Common between your Jiban.Application project and your Jiban.Infrastructure project, which has AuthPermissions.AspNetCore in it. And the solution is in the error "add Microsoft.CodeAnalysis.Common 4.8.0 directly to project Jiban.Application". But why??

When I compiled 6.2.0, which supports .NET 6, 7 and 8, I had the same problem as yours and the solution was to do what the error says - add a Microsoft.CodeAnalysis.Common version ???. But when I created 8.0.0 I didn't need to add any Microsoft.CodeAnalysis.??? any more because there wasn't a crashing of any of the analysers.

Things to try:

  1. If you were using AuthP 6.2.0 before, and updated to AuthP 8.0.0, then I would be a good idea to use "Build>Clean Solution" and then "Build>Rebuild Solution". Maybe it will sort out the analysers.
  2. Try AuthP 6.2.0 to see if there is a difference.
  3. If nothing else works then just add Microsoft.CodeAnalysis.Common 4.8.0 directly to project Jiban.Application as the error says.

JonPSmith avatar May 28 '24 14:05 JonPSmith

Hi @raulidavid,

Can I close this issue? It would useful if you could add a comment saying which approach works for you. That would help other users if they have the same type of problem.

JonPSmith avatar Jun 05 '24 12:06 JonPSmith

I am using the latest version of authp v8.0.0 but I am inheriting from legacy authp classes, I am going to validate it

raulidavid avatar Jun 09 '24 01:06 raulidavid