Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to specify Custom Build Step in ASP.NET Core .csproj file?

$
0
0

(My first attempt at posting this seemed to simply fizzle with an error from the site, so all apologies if this is a duplicate.)

I have an ASP.NET Core project in Visual Studio 2017 and I need to add a custom pre-build step to copy the client files from the adjacent client project. The thing I am trying would at least be invoked by older ASP.NET MVC projects:

<Target Name="BeforeBuild"><Message Text="Copying Client Files..."/><Copy SourceFiles="..\MyProjectClient\**.*" DestinationFolder="wwwroot" OverwriteReadOnlyFiles="true" /></Target>

Looking at a Verbosity=Normal build of this project, the BeforeBuild target is never invoked, and I can't see any targets listed in what is invoked that look like good candidates. (I will probably have to fiddle a little with the SourceFiles and DestinationFolder paths to make the step actually work as intended, but I can only do that once the target is invoked.)

In the ASP.NET Core CSPROJ build scheme, what targets should I be using to intercept the build at various points? Is there anything I need to do to inform the build that I need specific targets included?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>