How can I publish an ASP.NET MVC project from the command line?
Asked Answered
E

2

10

I've got an existing web site that monitors an SVN repository for changes and when there is a check in, the new web site is built using aspnet_compiler and then a diff of what is on the production site is sftp'd up to a production web server. The entire continuous integration process is built using cruisecontrol.net.

I've refactored the entire site to use ASP.NET MVC and I am now trying to integrate into my build process. It seems that this has changed and I am not getting the same behavior as I used to get with a pre-MVC site. I'm unfortunately not making much progress because it seems that no one has done this yet. Has anyone got something like this to work in any form at all?

Automating the command line using "devenv" like a "regular project" does not work either. There are /Build command line switches but they just build in place. This command line does not expose the "Publish" mechanism that is built into the UI. There is even a {Project Name}.Publish.xml file in the project directory that seems like it is a manifest of what needs to be published. Just no way of automating that.

I'm just trying to emulate the "Publish {Project name}" under the build menu in VS 2008 MVC project from the command line.

Eustasius answered 4/4, 2009 at 21:51 Comment(0)
S
1

If you're using CruiseControl.net, you're 85% of the way to doing this. Are you able to use NAnt? That would definitely be the way to go.

If not, then I'd look into using msbuild from the command line rather than devenv as that wasn't designed to do what you want.

NAnt is definitely a great way to go. Though, with all the changes they've made to msbuild, it is certainly a great contender. Nant just recently got new life breathed back into it, so it should continue to be an excellent option.

Schuyler answered 5/3, 2010 at 15:56 Comment(1)
+1 Follow Nick DeVore's advice. This is the best way to do it, there are plenty of NANT scripts out there to use.Silesia
C
-1

When you create a MVC project this is a standard .net project and not a "web project", which are not the same thing. I think that aspnet_compiler is only for web projects, so maybe this is what is causing you problems. I don't know which build tool you are using, but try building it like any other .net project.

Crisp answered 4/4, 2009 at 23:5 Comment(1)
I'm just trying to emulate the "Publish {Project name}" under the build menu in VS 2008 MVC project.Eustasius

© 2022 - 2024 — McMap. All rights reserved.