question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Referencing nuget package breaks `dotnet publish`

See original GitHub issue

Hey @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:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
turowiczcommented, May 8, 2019

So the fix is to run:

RUN dotnet msbuild /t:restore /p:Configuration=Release

Instead of dotnet restore

0reactions
valerysntxcommented, May 8, 2019

@turowicz, @takuya-takeuchi Thank You guys too, this issue is designed to appreciate it 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found