sdk: dotnet publish takes too long, about 5 minutes
I am using following command
dotnet publish -p:PublishProfile=Properties\PublishProfiles\FolderProfile.pubxml -v:d
then it hangs since
1:7>Done building target "_RazorGetCopyToPublishDirectoryItems" in project "project.csproj".
Other projects publish so quick. I removed all not necessary folders from project.
Time Elapsed 00:04:48.26
Further technical details
- ASP.NET Core version 3.1.3
- IDE VS 16.5
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 15 (7 by maintainers)
I can confirm I’m having this issue as well, however, way more severe, an hour+ and MSBuild using 10-20GB/32GB of RAM to do a reactjs publish (net 7 web api project). Applied these csproj changes and it went from an hour+ down to 30sec
Your project has a fair number of “Content” files and it appears this one target that’s inspecting them might be taking way too long.
Could you try an experiment to see if it helps? To your project file add: