Anyone have experience using TFS to build and release a project using this template, especially the ng2 template?
We've enjoyed single-button builds and deploys, but have had no luck finding a way to incorporate node/ng2 solutions into TFS online.
Similar questions. For Azure deployments, in project.json, there used to be pre-publish tasks to run npm scripts. What is the story with csproj?
If you look at the latest code in the templates\Angular25Spa directory, there is the new .csproj file. It has all the magic code to run the webpack/npm scripts, and also to include all the generated files in your wwwroot\dist folder, which is tricky to figure out without this example.
https://github.com/aspnet/JavaScriptServices/blob/dev/templates/Angular2Spa/Angular2Spa.csproj
@rgamage Thanks for pointing out. I did my project migrated using dotnet migrate, which produces a little different
Existing Item group
<ItemGroup>
<Compile Remove="node_modules\**\*;Client\**\*" />
<Content Include="wwwroot\assets\**\*" />
<None Update="wwwroot\**\*;Views\**\*;Dockerfile">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
</ItemGroup>
Copied from Angular2Spa.csproj file:
<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="wwwroot\dist\**;" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
Can these two sections be combined or they are serving different purpose.
Its very difficult to understand XML :) or is there any documentation around new csproj schema?
Thanks
For general MSBuilds docs, please see https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild
As for your specific question about whether you can combine the two <ItemGroup> elements, yes as far as I know you can. But generally it's nice to keep independent concerns separate.
Awesome, Thanks @SteveSandersonMS .
Most helpful comment
Similar questions. For Azure deployments, in project.json, there used to be pre-publish tasks to run npm scripts. What is the story with csproj?