net core 3.0 (and higher) publish project with wrong dependencies
See original GitHub issuenet core 3.0 (and higher) publish project with wrong dependencies
I have console project ProblemMainApp. It has dependencies from Helper and Newtonsoft.Json 12.0.2. Helper.csproj depend from Microsoft.Extensions.Configuration.Json 2.0.1. Microsoft.Extensions.Configuration.Json 2.0.1 depend from Newtonsoft.Json 10.0.1.
I publish project with command:
dotnet publish -c Debug -f netcoreapp2.0 --force -r centos.7-x64 -o D:\Publish\test
If I have installed netcore 2.* on my comp, that in output folder have Newtonsoft.Json 12.0.2.
But if I have installed netcore 3.* on my comp, that in output folder have Newtonsoft.Json 10.0.1 and program not working. I need to add a reference to Newtonsoft.Json 12.0.2 in Helper.csproj, even though it’s not needed.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:49 (3 by maintainers)
Top Results From Across the Web
Published output looking for wrong dependency
Goal. I have two .NET Core console applications - Application.dll and Updater.dll . I want to publish Updater.
Read more >dotnet publish command - .NET CLI
dotnet publish - Publishes the application and its dependencies to a folder for deployment to a hosting system.
Read more >Wrong DLL being used in release : r/dotnet
Or only on Publish? I am seeing an issue where the wrong version of DLLs gets published, but it doesn't affect Debug/Release builds...
Read more >Dependency Management in Visual Studio: NuGet and Beyond
Learn how to manage NuGet package dependencies for your .NET projects using Visual Studio.
Read more >Deploying an ASP.NET core application with Elastic Beanstalk
The dotnet publish command generates compiled classes and dependencies that you can bundle with a web.config file to create a site archive. The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Been having this issue again, it’s essentially making my application unusable, I publish it, some dependency doesn’t work, publish it again after somehow fixing it, another dependency doesn’t work, app just endlessly crashes for my users. This is getting frustrating.
It helps if you can get from the main .csproj to any other .csproj by dependencies. In my case, the dependencies are pulled through a .dll using AutoFac.