tags:

views:

45

answers:

3

I'm wondering if anyone has some solid advice for me. I'm trying to see if MSBuild is an appropriate tool for a client-side application (sold, commercial product). For example, if on the client machine there is .NET 4.0 and my program, I want users to be able to create screen savers and save them as an EXE.

So far, all I've seen is MSBuild being used for ASP.NET and build machines in a controlled environment, but is it appropriate to use it "in the wild" for a scenario such as described above?

+3  A: 

I can't advise whether it is appropriate or not in your particular case, but since it is included in the .NET Framework setup, it is reliable to use it.

Fredrik Mörk
+1: It's as part of the framework as anything else.
Preet Sangha
+3  A: 

Overkill

MSBuild is great for managing complex projects with many interdependencies. If all you want to do though is generate an EXE from a simple set of inputs, like the screensaver scenario you used, I'd just use the C# APIs for calling the compiler or call csc.exe directly.

Jay
I guess I don't understand the main difference here between using MSBuild and System.CodeDom.Compiler? Why would one be used over the other? How is MSBuild overkill?
WinnerWinnerChickenDinner
@Winner For one, it's overkill because you would need to generate an MSBuild script for the client target environment instead of just running a compile with the desired parameters.
Filburt
MSBuild is essentially a scripting language/scirpt parser for calling the compiler and any other utilities that may be needed as part of a 'full build process' (e.g. building resources, copying files, calling codesigning tools, etc.) It sounds like you just need to generate some inputs and then call the compiler, so you don't need a scripting language to do that, you can keep it simple and just call the compiler via its APIs (System.CodeDom.Compile) or via its command line utility (csc.exe).
Jay
+1  A: 

What you have to ask yourself here is how transparent you want msbuild to be? I would not advise using a command line and giving clients these commands and parameters, but if you mask it and have a good presentation layer that keeps all the technical stuff hidden then it's a pefectly good idea.

My current project relies pretty heavily on msbuild when installing, it works great and no one would know unless they seen the code.

Hope this helps.

Dave
that's a good point. i wouldn't want the end user to see anything development-related. my app would call MSBuild and the only thing a user may see is a progress bar. do you have any tips on how to make it all invisible to an end user?
WinnerWinnerChickenDinner