复制VS2008"发布网站"在命令行 [英] Replicate VS2008 "Publish Web Site" from command line

查看:270
本文介绍了复制VS2008"发布网站"在命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图复制在构建脚本这一对话在Visual Studio 2008的确切功能:

I am trying to replicate the exact functionality of this dialogue in Visual Studio 2008 in a build script:

这是一个ASP.NET的网站的,不是一个网络的应用程序

This is an ASP.NET web site, not a web application.

我用Google搜索解决这个转身了相当多的东西涉及的MSBuild,但是这一切似乎关心布局为ASP.NET Web应用程序的解决方案:

I have Googled around this and turned up quite a bit of stuff involving MSBuild, but this all seems to concern solutions laid out as ASP.NET Web Applications:

<一个href=\"http://www.driebier.net/post/Using-MSBuild-to-deploy-visual-studio-2005-web-applications.aspx\">http://www.driebier.net/post/Using-MSBuild-to-deploy-visual-studio-2005-web-applications.aspx
<一href=\"http://blog.donnfelker.com/post/TFS-Build-Not-Publishing-Web-Applications.aspx\">http://blog.donnfelker.com/post/TFS-Build-Not-Publishing-Web-Applications.aspx

本文似乎是相关的ASP.NET Web站点,但我发现我越来越想使用这些建议建立时的错误:

This article seems to be relevant to ASP.NET Web Sites, but I find that I'm getting an error when trying to build using those suggestions:


C:\dev\T&A>msbuild /t:_CopyWebApplication /property:OutDir=c:\temp\taweb\ /prope
rty:WebProjectOutputDir=c:\temp\taweb\

Microsoft (R) Build Engine Version 3.5.30729.1
[Microsoft .NET Framework, Version 2.0.50727.3074]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 22/04/2009 11:50:42.
Project "C:\dev\T&A\TAWeb.sln" on node 0 (_CopyWebApplication target(s)).
  Building solution configuration "Debug|.NET".
C:\dev\T&A\TAWeb.sln : error MSB4057: The target "_CopyWebApplication" does not
 exist in the project.
Done Building Project "C:\dev\T&A\TAWeb.sln" (_CopyWebApplication target(s)) --
 FAILED.


Build FAILED.

"C:\dev\T&A\TAWeb.sln" (_CopyWebApplication target) (1) ->
  C:\dev\T&A\TAWeb.sln : error MSB4057: The target "_CopyWebApplication" does n
ot exist in the project.

0 Warning(s)

1 Error(s)

Time Elapsed 00:00:00.06

我想发布的(继承,而不是我自己)不具有的.csproj文件(在那里我可以导入从C _CopyWebApplication目标的解决方案:\\ Program Files文件(x86)的\\的MSBuild \\微软\\ VisualStudio的\\ V9 .0 \\ web应用\\ Microsoft.WebApplication.targets)

The solution I'm trying to publish (inherited, not my own) doesn't have .csproj files (where I could import the _CopyWebApplication target from C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets)

也许这是一个Visual Studio 2005/2008区别?

Perhaps this is a Visual Studio 2005/2008 difference?

不管怎样,我觉得我会错了路那里。

Anyway, I feel that I'm going down the wrong path there.

基本上我只需要实现的究竟的上面有哪些对话的做法,但在命令行。

Essentially I just need to achieve exactly what the above dialogue does, but from the command line.

非常感谢

推荐答案

以下命令将复制的发布网站的使用默认设置对话框。

The following command duplicates the Publish Web Site dialog with default settings.

aspnet_compiler -nologo -v / -pC:\\的WebSite1-uC:\\ TARGETPATH​​

1)见的社区内容的标题为你想发布一个网站,但你没有的Visual Studio然后... 的在<一个href=\"http://msdn.microsoft.com/en-us/library/20yh9f1b%28classic%29.aspx\">http://msdn.microsoft.com/en-us/library/20yh9f1b%28classic%29.aspx.

1) See Community Content titled You want Publish a site but you have not Visual Studio then... at http://msdn.microsoft.com/en-us/library/20yh9f1b%28classic%29.aspx.


  • 微软的Visual Studio 2005> Visual Studio 2005命令提示符

  • 微软的Visual Studio 2008> Visual Studio 2008的命令提示符

  • Microsoft .NET框架SDK 2.0> SDK命令提示

2)请参见ASP.NET编译工具(Aspnet_compiler.exe)在<一个href=\"http://msdn.microsoft.com/en-us/library/ms229863.aspx\">http://msdn.microsoft.com/en-us/library/ms229863.aspx.

2) See "ASP.NET Compilation Tool (Aspnet_compiler.exe)" at http://msdn.microsoft.com/en-us/library/ms229863.aspx.

3)继的演练摘录:部署ASP.NET Web应用程序使用XCOPY 的在<一个href=\"http://msdn.microsoft.com/en-us/library/f735abw9.aspx\">http://msdn.microsoft.com/en-us/library/f735abw9.aspx

作为替代使用XCOPY
  命令行工具,其被支撑
  由.NET Framework的所有版本,
  您可以使用新的.NET Framework 2.0
  工具位于
  的%SystemRoot%\\ Microsoft.NET \\框架\\ *版本
  2或更高版本* \\ Aspnet_compiler.exe到
  编译和部署Web
  应用。欲了解更多信息,请参见 ASP.NET编译工具(Aspnet_compiler.exe)

As an alternative to using the XCOPY command-line tool, which is supported by all versions of the .NET Framework, you can use the new .NET Framework 2.0 tool located at %SystemRoot%\Microsoft.NET\Framework\*version 2 or later*\Aspnet_compiler.exe to compile and deploy your Web application. For more information, see ASP.NET Compilation Tool (Aspnet_compiler.exe).

4)继的如何摘录:precompile ASP.NET Web站点部署的在<一个href=\"http://msdn.microsoft.com/en-us/library/ms227976.aspx\">http://msdn.microsoft.com/en-us/library/ms227976.aspx.

如果您的网站是不是互联网
  信息服务(IIS)应用程序
  因此具有在IIS没有条目
  元数据库,用下面的值
  -v选项。

If your Web site is not an Internet Information Services (IIS) application and therefore has no entry in the IIS metabase, used the following value for the -v switch.

aspnet_compiler -p
  physicalOrRelativePath -v /
  TARGETPATH​​

在这种情况下,
  physicalOrRelativePath参数
  指的是完全限定
  目录路径,其中该网站
  文件的位置,或路径相对于
  当前目录。时期
  (。)运算被允许在
  physicalOrRelativePath参数。该
  -v选项指定一个根,编译器将使用来解决
  应用程序根引用(
  例如,用代字号(〜)运算)。
  当您指定/为价值
  -v选项的编译器会
  使用物理解析的路径
  路径的根。

In this case, the physicalOrRelativePath parameter refers to the fully qualified directory path in which the Web site files are located, or a path relative to the current directory. The period (.) operator is allowed in the physicalOrRelativePath parameter. The -v switch specifies a root that the compiler will use to resolve application-root references (for example, with the tilde (~) operator). When you specify the value of / for the -v switch the compiler will resolve the paths using the physical path as the root.

这篇关于复制VS2008&QUOT;发布网站&QUOT;在命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆