How can I build, test, and publish the same files for ASP.NET Core application?

Viewed 40

I have a Blazor WASM hosted setup using .NET 7.0 RC1.

This is what I have set up in my CI now:

dotnet build -c Release
dotnet test -c Release
dotnet publish --no-restore -c Release -o ./deploy

However, the publish step rebuilds the app again with different files, and some optimizations for the final deploy.

Is it possible to run my tests on that final build instead of an intermediate build?

I'm asking because I've seen faulty builds a few times (on Blazor app .NET 6.0) where most everything works but there's a tiny bug in one section of the app, and so I'd really like to be able to test against the final build to prevent that.

0 Answers
Related