Assembly version conflict .NET Core 3.1 on Microsoft.CodeAnalysis.CSharp #276

Closed
opened 2025-12-29 08:25:15 +01:00 by adam · 2 comments
Owner

Originally created by @zippermachine on GitHub (May 22, 2020).

Hello, I am writing tests and need to mock external API. My project is written for .NET Core 3.1 due to I try to use preview version of WireMock.Net 1.2.11-ci-13373 but I am unable to add preview version of nuget package to my project because of problem described bellow.

Installing Handlebars.Net.Helpers 1.0.0.
Installing WireMock.Net.Abstractions 1.2.11-ci-13373.
Installing WireMock.Net 1.2.11-ci-13373.
NU1608: Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.CSharp.Workspaces 3.3.1 requires Microsoft.CodeAnalysis.CSharp (= 3.3.1) but version Microsoft.CodeAnalysis.CSharp 3.4.0 was resolved.
NU1107: Version conflict detected for Microsoft.CodeAnalysis.Common. Install/reference Microsoft.CodeAnalysis.Common 3.4.0 directly to project UnitTests to resolve this issue. 
 UnitTests -> WireMock.Net 1.2.11-ci-13373 -> CS-Script.Core 1.3.1 -> Microsoft.CodeAnalysis.Scripting.Common 3.4.0 -> Microsoft.CodeAnalysis.Common (= 3.4.0) 
 UnitTests -> MyService.Api -> Microsoft.VisualStudio.Web.CodeGeneration.Design 3.1.3 -> Microsoft.VisualStudio.Web.CodeGenerators.Mvc 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration.Core 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration.Templating 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration.Utils 3.1.3 -> Microsoft.CodeAnalysis.CSharp.Workspaces 3.3.1 -> Microsoft.CodeAnalysis.Common (= 3.3.1).
Package restore failed. Rolling back package changes for 'UnitTests'.
Originally created by @zippermachine on GitHub (May 22, 2020). Hello, I am writing tests and need to mock external API. My project is written for .NET Core 3.1 due to I try to use preview version of WireMock.Net 1.2.11-ci-13373 but I am unable to add preview version of nuget package to my project because of problem described bellow. ``` Installing Handlebars.Net.Helpers 1.0.0. Installing WireMock.Net.Abstractions 1.2.11-ci-13373. Installing WireMock.Net 1.2.11-ci-13373. NU1608: Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.CSharp.Workspaces 3.3.1 requires Microsoft.CodeAnalysis.CSharp (= 3.3.1) but version Microsoft.CodeAnalysis.CSharp 3.4.0 was resolved. NU1107: Version conflict detected for Microsoft.CodeAnalysis.Common. Install/reference Microsoft.CodeAnalysis.Common 3.4.0 directly to project UnitTests to resolve this issue. UnitTests -> WireMock.Net 1.2.11-ci-13373 -> CS-Script.Core 1.3.1 -> Microsoft.CodeAnalysis.Scripting.Common 3.4.0 -> Microsoft.CodeAnalysis.Common (= 3.4.0) UnitTests -> MyService.Api -> Microsoft.VisualStudio.Web.CodeGeneration.Design 3.1.3 -> Microsoft.VisualStudio.Web.CodeGenerators.Mvc 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration.Core 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration.Templating 3.1.3 -> Microsoft.VisualStudio.Web.CodeGeneration.Utils 3.1.3 -> Microsoft.CodeAnalysis.CSharp.Workspaces 3.3.1 -> Microsoft.CodeAnalysis.Common (= 3.3.1). Package restore failed. Rolling back package changes for 'UnitTests'. ```
adam added the question label 2025-12-29 08:25:15 +01:00
adam closed this issue 2025-12-29 08:25:15 +01:00
Author
Owner

@StefH commented on GitHub (May 22, 2020):

This is a known issue (however not related to a preview version from WireMock.Net, this happens for the normal versions also):

Can you try this solution:
https://github.com/WireMock-Net/WireMock.Net/wiki/Conflict-on-Microsoft.CodeAnalysis.CSharp

@StefH commented on GitHub (May 22, 2020): This is a known issue (however not related to a preview version from WireMock.Net, this happens for the normal versions also): - https://github.com/WireMock-Net/WireMock.Net/issues/448 Can you try this solution: https://github.com/WireMock-Net/WireMock.Net/wiki/Conflict-on-Microsoft.CodeAnalysis.CSharp
Author
Owner

@zippermachine commented on GitHub (May 22, 2020):

Thanks.

@zippermachine commented on GitHub (May 22, 2020): Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#276