Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

ProjectReference conflicts Transitive PackageReference

$
0
0

This question has been discussed on several topics here but I can't find a solution for my case.

I have a library project I'm working on. Let's call it LibraryProject.

To test and validate it during the development process, I have another project in my vs solution. Let's call it LibraryProject.TestService.

The Library.TestService references the LibraryProject with a ProjectReference. It allows me to locally test the update of the LibraryProject without uselessly creating a nuget package and import it on a test project.

<ItemGroup><ProjectReference Include="..\LibraryProject\LibraryProject.csproj" /></ItemGroup>

The LibraryProject is part of a core package that I import on all my projects. Let's call it SharedLibraries.I specified in the SharedLibraries.config.nuspec that the LibraryProject is a dependency and is required :

<dependencies><dependency id="LibraryProject" version="1.0.13" /></dependencies>

So, everything is fine, when I include the SharedLibraries package, it also includes the LibraryProject as a Transitive Package.

But to make my life easier, my LibraryProject.TestService also includes the SharedLibraries package, and so it also includes the LibraryProject as a Transitive Package.

Now, when I try to run my project, I get a conflict error :

An assembly with the same simple name 'LibraryProject' has already been imported. Try removing one of the references (for example, '[...].libraryproject\1.0.13\lib\net70\LibraryProject.dll') or sign them to enable side-by-side execution.

And before this, I also get a warning :

warning MSB3243: Unable to resolve conflict between "LibraryProject, Version=1.0.13.0, Culture=neutral, PublicKeyToken=null" and "LibraryProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null". Arbitrarily choosing "LibraryProject, Version=1.0.13.0, Culture=neutral, PublicKeyToken=null".

The version 1.0.0.0 is obviously my local project. The one I want to include.

Unfortunately I can't override or even remove a Transitive Dependency.

How could I solve this conflict please ?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>