0

I'd like to start exploring options outside of msbuild for scripting my builds, like CAKE or FAKE.

What's the best practice for developing .NET Core in Visual Studio but using external build scripts? Like, how does this actually work in practice?

  • I'd like to continue to take full advantage of the VS environment, including Intellisense, package management, IDE features like Go To Definition, etc.
  • Do people somehow customize/override the VS F5 and/or Ctrl-Shift-B behaviors? Or do they use .csproj files and let VS and msbuild do its own thing until it's time to generate a "real" build, and then run their own scripts at that time?
Joy
  • 1,171
  • 9
  • 15
nlawalker
  • 6,364
  • 6
  • 29
  • 46

1 Answers1

0

Locally on your development machine you usually run build scripts from command line. You don't write build script to help you while developing. You write them that your code is verified by an automated build and that you automate processes like creating deployment packages, publishing nuget packages...

Most common practice is contionous integration approach. This means that when you or someone in your team commits/pushes code to the version control system(like git svn...) your selected continuous integration tool (like jenkins, team city...) pulls source code from version control system and runs your build script which for example compiles your code, run tests, creates deployment package.

I would also suggest that you take a look at flubu. Flubu is a cross platform build automation tool for building projects and executing deployment scripts using C# code. It's easy to learn beacuse you write your build script entirely in c#. More about flubu can be readed here: https://stackoverflow.com/a/46776658/3118784

Stan88
  • 252
  • 3
  • 12
  • "You usually run build scripts from command line" - but do you still build within Visual Studio as well for compiler checking, debugging etc? This is the primary part I'm not sure about - the need to maintain both "full" build scripts as well as the msbuild experience to support VS, etc. – nlawalker Jan 17 '18 at 20:30
  • Yes sure you still build and do other things(but you dont write some custom targets in msbuild if that's what you are asking?) from visual studio when u are developing. When u finish developing a feature then u run your build script locally so that u see if it compiles, tests passes... and if it completes successfully then u push your code to your version control system. After that your continous integration software pulls code from it and runs your build script on build server. – Stan88 Jan 17 '18 at 20:57
  • I think you might have misunderstood why to use build script's and why to automate your build process. Maybe read this short article: https://www.thoughtworks.com/continuous-integration – Stan88 Jan 18 '18 at 04:41