Deployment error with nested assets #962

Closed
opened 2025-08-09 17:18:20 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @colltoaction on 3/6/2017

I'm deploying my AngularSpa-based application to Azure using WebDeploy. Every time I had to deploy twice, because the first time I always got this error for a couple of files:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Publish.targets(100,5): Error MSB3030: Could not copy the file "C:\Repos\Solution\Project\wwwroot\dist\assets\asset-name.jpg" because it was not found.

It seems to be fixed now that I changed this in the csproj file (note wwwroot\dist\**\** vs the template's wwwroot\dist\**):


<!-- Include the newly-built files in the publish output -->
<ItemGroup>
  <DistFiles Include="wwwroot\dist\**\**; ClientApp\dist\**" />
  <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
    <RelativePath>%(DistFiles.Identity)</RelativePath>
    <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
  </ResolvedFileToPublish>
</ItemGroup>
*Originally created by @colltoaction on 3/6/2017* I'm deploying my AngularSpa-based application to Azure using WebDeploy. Every time I had to deploy twice, because the first time I always got this error for a couple of files: ``` C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Publish.targets(100,5): Error MSB3030: Could not copy the file "C:\Repos\Solution\Project\wwwroot\dist\assets\asset-name.jpg" because it was not found. ``` It seems to be fixed now that I changed this in the `csproj` file (note `wwwroot\dist\**\**` vs the template's `wwwroot\dist\**`): ```xml <!-- Include the newly-built files in the publish output --> <ItemGroup> <DistFiles Include="wwwroot\dist\**\**; ClientApp\dist\**" /> <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)"> <RelativePath>%(DistFiles.Identity)</RelativePath> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> </ResolvedFileToPublish> </ItemGroup> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#962
No description provided.