Referencing nuget package breaks `dotnet publish`
See original GitHub issueHey @takuya-takeuchi
Unfortunately after moving from self-compiled to using a nuget package the dotnet publish
command seems to be broken:
Step 6/111 : RUN dotnet publish src/${project}/${project}.csproj -c Release -o /app/out/ --no-restore --no-build
---> Running in dd8dc333ad2e
Microsoft (R) Build Engine version 16.0.450+ga8dc7f1d34 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
/usr/share/dotnet/sdk/2.2.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(169,5): error MSB3030: Could not copy the file "obj/x64/Release/netcoreapp2.2/People.Service.pdb" because it was not found. [/app/src/People.Service/People.Service.csproj]
/usr/share/dotnet/sdk/2.2.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(169,5): error MSB3030: Could not copy the file "obj/x64/Release/netcoreapp2.2/People.Service.dll" because it was not found. [/app/src/People.Service/People.Service.csproj]
/usr/share/dotnet/sdk/2.2.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(169,5): error MSB3030: Could not copy the file "/app/src/People.Common/bin/x64/Release/netcoreapp2.2/People.Common.dll" because it was not found. [/app/src/People.Service/People.Service.csproj]
/usr/share/dotnet/sdk/2.2.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(169,5): error MSB3030: Could not copy the file "/app/src/People.Service.Hub/bin/x64/Release/netcoreapp2.2/People.Service.Hub.dll" because it was not found. [/app/src/People.Service/People.Service.csproj]
The command '/bin/sh -c dotnet publish src/${project}/${project}.csproj -c Release -o /app/out/ --no-restore --no-build' returned a non-zero code: 1
I’m using AnyCPU
so for all my projects and suddenly after referencing the DlibDotNet
the publisher is looking for an x64
compilation folder. Switching from AnyCPU
to x64
in the .csproj
file doesn’t help.
My references below, CUDA only in Release
configuration:
<PackageReference Include="DlibDotNet" Version="19.17.0.20190429" Condition="'$(Configuration)' == 'Debug'"/>
<PackageReference Include="DlibDotNet-WithCUDA" Version="19.17.0.20190429" Condition="'$(Configuration)' == 'Release'"/>
Any ideas?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
c# - How does nuget handle project references when ...
1 Answer 1 ... It depends on the options you supply to the command to create the nuget package. You can either create...
Read more >PackageReference in project files - NuGet
Package references, using <PackageReference> MSBuild items, specify NuGet package dependencies directly within project files, as opposed to ...
Read more >PackageReference is not resolved while it works in Visual ...
In my case the root cause of this issue was old Nuget.exe version. Old version used old MsBuild v14 instead on v15 and...
Read more >SDK-3.1.300 dotnet publish .sln now chooses the older ...
Our solution doesn't even directly reference older nuget packages, it references nuget packages that reference nuget packages etc. Visual studio ...
Read more >Reinstalling and Updating NuGet Packages
Details on when it's necessary to reinstall and update packages, as with broken package references in Visual Studio.
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 Free
Top 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
So the fix is to run:
Instead of
dotnet restore
@turowicz, @takuya-takeuchi Thank You guys too, this issue is designed to appreciate it 😃