[英]How to publish an ASP.NET web site or web application to a file system on the command line in Visual Studio 2012
According to the answer from this SO article , command line publishing to FTP or file system is no longer supported in VS2012. 根据本文的答案,VS2012不再支持将命令行发布到FTP或文件系统。 Nevertheless, this requirement remains for my project.
但是,此要求仍然适用于我的项目。 I imagine other people and projects have the same requirement.
我想象其他人和项目有相同的要求。
What is a good way to do this? 什么是这样做的好方法?
I know that at least one answer is to use Web Deploy . 我知道至少一个答案是使用Web Deploy 。 That's not going to work for me.
那对我不起作用。 I imagine it doesn't work for others as well.
我想这对其他人也不起作用。
My project already uses MSBuild on the command line. 我的项目已经在命令行上使用MSBuild。 It would be OK to add some kind of post-build event or extra build configuration called "CustomPublish" or some such.
添加某种类型的生成后事件或称为“ CustomPublish”的额外生成配置或类似的配置是可以的。 We could xcopy the result somewhere in the post-build event.
我们可以将结果复制到构建后事件中的某个位置。 Something like:
msbuild /p:Configuration=CustomPublish
像这样的东西:
msbuild /p:Configuration=CustomPublish
The problem is how to get Visual Studio to emit the final result without any "extras" like .pdb files and such. 问题是如何使Visual Studio发出最终结果而没有任何“附加”(如.pdb文件等)。
To have MSBuild not emit the debug symbols pass the following properties via the command line: 若要使MSBuild不发出调试符号,请通过命令行传递以下属性:
MSBuild.exe solution.sln /p:DebugSymbols=false /p:DebugType=None MSBuild.exe solution.sln / p:DebugSymbols = false / p:DebugType = None
You could also put these values in the new configuration you mentioned : 您也可以将这些值放在您提到的新配置中:
<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
I would take a look at this MSDN link as well: Web Deployment Overview for Visual Studio and ASP.NET 我还将看一下该MSDN链接: Visual Studio和ASP.NET的Web部署概述
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.