I’ve been using mouse right click in Visual Studio to publish sites for ages and everything worked great except there’s been too much manual works. Recently I changed to using build script to call aspnet_compiler to publish ASP.NET web application. In my build script I would do something like below:
sh "#{aspnet_compiler} -p ../src/webapp -v targetDir ./publish –u"
My project directory structure looks like this:
/build/rakefile.rb
/build/publish/ --published site goes here
/src/website/bll/ --business logic goes here
/src/website/ --aspx pages
/src/website/code/ --some c# code
When calling aspnet-compiler everything worked fine except the c# code under /src/website/code/ would not be compiled. It seems to me that aspnet-compiler compiled c# code under bll directory then xcopied everything under /src/website/ to the publish directory (including /src/website/code/). I don’t know if I am not using the correct switch calling aspnet-compiler or this is the desired behaviour?
Please help thanks!
I figured out my own problem.
First of all my rake build script end up looking like this:
sh "#{aspnet_compiler} -f -fixednames -u -p ../src/website -v / ./publish"
Second the output behaviour of mouse right click on "publish" within Visual Studio is different from calling aspnet_compiler.
Right click publish will:
where when calling aspnet_compiler:
There was a clean up task after publish task that basically deleted anything other than .dll extension under bin.
Anyway now I've learnt something new.