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.

dotnet publish --no-build with separate build

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I am working on a container build for an aspnetcore project in an azure devops pipeline. For better debugging I am trying to use a separate ‘dotnet build’ and ‘dotnet publish’ commands. That section of the container file looks like this.

RUN dotnet build --configuration Debug --no-restore --no-incremental --use-current-runtime \
    --verbosity=minimal

RUN dotnet publish --configuration Debug --no-build \
    --verbosity=minimal \
    {project csproj file location}

This is the error from the docker build task in ADO

/usr/share/dotnet/sdk/6.0.405/Sdks/Microsoft.NET.Sdk.Razor/targets/Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(680,7): error : Manifest file at 'obj/Debug/net6.0/staticwebassets.build.json' not found.

This error is nearly identical to that found in another issue, https://github.com/dotnet/aspnetcore/issues/41149, but that issue was closed after the author found it was fixed but changing ‘release’ to ‘Release’, but that does not seem to be relevant here. I confirmed the same result with either Debug or Release. Combining the two commands as such works.

RUN dotnet publish --configuration Debug \
    --verbosity=minimal \
    {project csproj file location}

.NET Version

6.0.405

Issue Analytics

  • State:open
  • Created 8 months ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mkArtakMSFTcommented, Jan 24, 2023

@pcappaert can you also confirm if this repros for .NET 7?

0reactions
pcappaertcommented, Jan 24, 2023

yes, I see the same error when I update the repro project and Containerfile to use .NET 7

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet publish command - .NET CLI
The dotnet publish command calls MSBuild, which invokes the Publish target. If the IsPublishable property is set to false for a particular ...
Read more >
Why bother with dotnet build before dotnet publish?
1 Answer 1 ... You are right that dotnet publish automatically does everything dotnet build already does. In most cases - as in...
Read more >
dotnet-publish --no-build produces assembly with versions ...
The way nobuild is supposed to work is that the compile target is not invoked. It is separate from whether Compile would be...
Read more >
A Guide to Missing Publish Directory – Write it Down
When building out a pipeline, it is nice first to run the commands on your local repository to verify that you understand what...
Read more >
What is Recommended Setup for "dotnet build" Artifact ...
I have a variety of dotnet core applications setup with build configurations on our TeamCity ... BOBTheOrderBuilder.csproj --output publish --no-build ...
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