-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
Description
Per Javier ...
dotnet publishdoes not automatically clean the target folder before publishing. It simply generates the necessary files for deployment based on the current state of the project and places them in the specified output folder.If you want to ensure the target folder is cleaned before publishing, you need to remove the files from the folder first. Alternatively, you might try
dotnet clean(although I don't think it works for that) or you can specify a new or empty output directory for the published files through the CLI or Visual Studio.
Provide ...
-
VS approach in publish configuration: Settings > File Publish Options> Delete all existing files prior to publish
-
MSBuild target to enforce a clean publish folder ...
<Target Name="_RemovePublishDirBeforePublishing" BeforeTargets="BeforePublish"> <RemoveDir Directories="$(PublishDir)" Condition="'$(PublishDir)' != ''" /> </Target>
Cross-refs:
- [Blazor] Publish does not correctly clean publish\wwwroot\_framework folder aspnetcore#61364
- BlazorWasm -
Cleanafter aPublishleaves files behind aspnetcore#36546
Page URL
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/host-and-deploy/index.md
Document ID
c82cf121-831d-75dd-a796-c735aad3b3e9
Platform Id
503f69d7-fc1b-3879-cc1d-b6775ebf03cc
Article author
Metadata
- ID: e07aaa4d-4ad4-778f-f74a-60d8f05d9075
- PlatformId: 503f69d7-fc1b-3879-cc1d-b6775ebf03cc
- Service: aspnet-core
- Sub-service: blazor
Metadata
Metadata
Assignees
Labels
Type
Projects
Status