Is there a Visual Studio C# equivalent of the Visu

2019-06-26 07:27发布

问题:

In Visual C++ inside Visual Studio, one of the project subtypes is a "Makefile Project".

But there doesn't seem to be an equivalent for Visual C# inside Visual Studio?


BTW, a Makefile project is:

If you have a project that you build from the command line with a makefile, then the Visual Studio development environment will not recognize your project. To open and build your project using Visual Studio, first create an empty project containing the appropriate build settings using the Makefile Project Wizard. You can then use this project to build your project from the Visual Studio development environment.

The project displays no files in Solution Explorer. The project specifies the build settings, which are reflected in the project's property page.

回答1:

The equivalent of make in Visual Studio world is msbuild. Visual Studio does not use make. .csproj, .vbproj etc. are input files for msbuild. You can do pretty much the same stuff in them as in conventional makefiles, including command line building, custom targets etc.



回答2:

There's nothing C++-specific about the Makefile project type; it just runs a command line. It's just that it's listed along with the Visual C++ project types. You can add one to a solution that otherwise contains nothing but C# projects.

Alternatively, you could set up a pre-build step in your C# project that directly runs nmake, msbuild or even NAnt.



回答3:

Msbuild is what is used to build your projects when you hit the Play button. Personally I like NAnt + NantContrib it was easier for me to pick up and start using right away. For all new projects I use tree surgeon this tool creates a default build script and proper build tree with testing project and code coverage report.