Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
736 views
in Technique[技术] by (71.8m points)

visual studio 2010 - VS2010 Web Publish command line version of File System deploy

Folks,

In a nutshell, I want to replicate this dialog: alt text

It's a Visual Studio 2010 ASP.Net MVC project. If I execute this command, I get all the files I want, including the transformed web.configs in the "C:ToDeploy" directory.

I want to replicate this on the command line so I can use it for a QA environment build.

I've seen various articles on how to do this on the command line for Remote Deploys, but I just want to do it for File System deploys.

I know I could replicate this functionality using nAnt tasks or rake scripts, but I want to do it using this mechanism so I'm not repeating myself.

I've investigated this some more, and I've found these links, but none of them solve it cleanly:

Thanks in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Ok, finally figured this out.

The command line you need is:

msbuild path/to/your/webdirectory/YourWeb.csproj /p:Configuration=Debug;DeployOnBuild=True;PackageAsSingleFile=False

You can change where the project outputs to by adding a property of outdir=c:wherever in the /p: section.

This will create the output at:

path/to/your/webdirectory/obj/Debug/Package/PackageTmp/

You can then copy those files from the above directory using whatever method you'd like.

I've got this all working as a ruby rake task using Albacore. I am trying to get it all done so I can actually put it as a contribution to the project. But if anyone wants the code before that, let me know.

Another wrinkle I found was that it was putting in Tokenized Parameters into the Web.config. If you don't need that feature, make sure you add:

/p:AutoParameterizationWebConfigConnectionStrings=false

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...