Project Fails to build/Publish #463

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

Originally created by @vijayrkn on 8/30/2017

Sample csproj from user:

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp1.1</TargetFramework> <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> <IsPackable>false</IsPackable> <TypeScriptToolsVersion>2.3</TypeScriptToolsVersion> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.2" /> <PackageReference Include="Microsoft.AspNetCore.Identity" Version="1.1.2" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" /> <PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="1.1.1" /> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" /> <PackageReference Include="Serilog.Extensions.Logging" Version="1.4.0" /> </ItemGroup> <ItemGroup> <!-- Files not to show in IDE --> <None Remove="yarn.lock" />
 &lt;!-- Files not to publish (note that the 'dist' subfolders are re-added below) --&gt;
 &lt;Content Remove="ClientApp\**" /&gt;
</ItemGroup> <ItemGroup> <Content Include="ClientApp\dist\papaparse.min.js" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Domain.Data\Domain.Data.csproj" /> <ProjectReference Include="..\Domain.Model\Domain.Model.csproj" /> </ItemGroup> <Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish"> <!-- As part of publishing, ensure the JS resources are freshly built in production mode --> <Exec Command="npm install" /> <Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" /> <Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />
 &lt;!-- Include the newly-built files in the publish output --&gt;
 &lt;ItemGroup&gt;
   &lt;DistFiles Include="wwwroot\dist\**; ClientApp\dist\**" /&gt;
   &lt;ResolvedFileToPublish Include="@(DistFiles-&gt;'%(FullPath)')" Exclude="@(ResolvedFileToPublish)"&gt;
     &lt;RelativePath&gt;%(DistFiles.Identity)&lt;/RelativePath&gt;
     &lt;CopyToPublishDirectory&gt;PreserveNewest&lt;/CopyToPublishDirectory&gt;
   &lt;/ResolvedFileToPublish&gt;
 &lt;/ItemGroup&gt;
</Target> </Project>

Additional context on the issue - https://developercommunity.visualstudio.com/comments/103876/view.html

*Originally created by @vijayrkn on 8/30/2017* Sample csproj from user: ``` <Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp1.1</TargetFramework> <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> <IsPackable>false</IsPackable> <TypeScriptToolsVersion>2.3</TypeScriptToolsVersion> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.2" /> <PackageReference Include="Microsoft.AspNetCore.Identity" Version="1.1.2" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" /> <PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="1.1.1" /> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" /> <PackageReference Include="Serilog.Extensions.Logging" Version="1.4.0" /> </ItemGroup> <ItemGroup> <!-- Files not to show in IDE --> <None Remove="yarn.lock" /> &lt;!-- Files not to publish (note that the 'dist' subfolders are re-added below) --&gt; &lt;Content Remove="ClientApp\**" /&gt; </ItemGroup> <ItemGroup> <Content Include="ClientApp\dist\papaparse.min.js" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Domain.Data\Domain.Data.csproj" /> <ProjectReference Include="..\Domain.Model\Domain.Model.csproj" /> </ItemGroup> <Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish"> <!-- As part of publishing, ensure the JS resources are freshly built in production mode --> <Exec Command="npm install" /> <Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" /> <Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" /> &lt;!-- Include the newly-built files in the publish output --&gt; &lt;ItemGroup&gt; &lt;DistFiles Include="wwwroot\dist\**; ClientApp\dist\**" /&gt; &lt;ResolvedFileToPublish Include="@(DistFiles-&gt;'%(FullPath)')" Exclude="@(ResolvedFileToPublish)"&gt; &lt;RelativePath&gt;%(DistFiles.Identity)&lt;/RelativePath&gt; &lt;CopyToPublishDirectory&gt;PreserveNewest&lt;/CopyToPublishDirectory&gt; &lt;/ResolvedFileToPublish&gt; &lt;/ItemGroup&gt; </Target> </Project> ``` Additional context on the issue - https://developercommunity.visualstudio.com/comments/103876/view.html
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#463
No description provided.