tags:

views:

46

answers:

2

Correct me if I'm wrong - I understand a C#/.NET application's .csproj project file is effectively its makefile or build file.

A Website project does not have a .csproj file (not to be mixed up with Web Application which does). In the case of a Website project, can I create a makefile equivalent, or does it use a build process/instructions stored elsewhere in the system or app?

A: 

.csproj file mainly contains metadata information related your Environment your resource refrence, and MSBuild target to compile the specific project type,

You can Customize your website output by going to project property -> MSBuild Output section.

ManojTrek
A: 

You could roll your own build using NAnt and a custom build script that targets msbuild.exe (so you can call 2.0, 3.5, or 4.0 for .Net)

Might take a little bit but you could structure your project folders something like

  • src
  • src/MyWebProject (sln and such here)
  • tools
  • tools/nant/ (place all the NAnt files here)

Then you could create a batch file (something like deploy.bat) that calls NAnt and your build script:

@tools\nant\NAnt.exe -buildfile:deploy.build %*
pause

You can customize the deploy.build (the XML that tells NAnt what to do) to copy everything you need only for the web into something like a 'go-live' or 'deployment' folder.

Explaining what goes into the build file is a little verbose for here but there are plenty of example on the web. Just Google NAnt and .Net.

What is nice about NAnt is that for example you can call external tools like YUICompressor to minify all of your JS and CSS files for deployment. Make it ignore SVN or version control files. Call Unit tests, etc. That and you can make your own ready for the web folder that you just FTP up to your server.

subv3rsion