dotnet / dotnet/aspnetcore

dotnet publish --no-build with separate build

Open
#46,156 9 comments 3 reactions 0 assignees View on GitHub
area-mvc bug feature-static-web-assets
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is there an existing issue for this?

- [X] 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.