Hi Gareth Walker,
Thank you for reaching out to Microsoft Q & A forum.
Here are some steps to resolve the issue:
1.Manually Build the Angular App
Open a terminal in the ClientApp folder and run
npm install
npm run build
This should generate the dist folder inside ClientApp.
2.Check angular.json Configuration
Ensure the outputPath is set to ../wwwroot under the build options.
3.Verify .csproj Settings
Your project file should include a target to build and copy the Angular output to wwwroot during publish:
<Target Name="PublishSpa" AfterTargets="Publish">
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install && npm run build" />
<Copy SourceFiles="$(SpaRoot)dist\**" DestinationFolder="$(PublishDir)wwwroot" />
</Target>
4.Run Visual Studio as Administrator
This can help resolve permission-related issues.
5.Manually Copy the dist Folder (Temporary Solution)
If the issue persists, try manually copying ClientApp/dist into wwwroot before publishing.
Please feel free to contact us if you have any additional questions.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.