Skip to content

dotnet publish --no-build with separate build #46156

Description

@pcappaert

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, #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.feature-static-web-assets

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions