【问题标题】:How to compile a Web Site Project directly out of Visual Studio without aspnet_compiler?如何在没有 aspnet_compiler 的情况下直接从 Visual Studio 编译网站项目?
【发布时间】:2011-12-05 10:24:36
【问题描述】:

我有一个网站项目并希望编译我的 .aspx 和 .cs。为此,我正在使用这样的 aspnet 编译器:

aspnet_compiler -v /My_Site -p c:\site_published_with_Visual_Studio c:\site_compiled_with_aspnet_compiler

这意味着,我必须先用 Visual Studio 2010 发布我的网站,然后打开命令行调用 aspnet_compiler。

有没有办法直接用 Visual Studio 2010 编译网站项目,也许是通过点击而不是使用命令行?提前感谢您的帮助!

【问题讨论】:

  • 你看过MSBuild吗?
  • 如果您右键单击项目或解决方案节点,您应该会看到“发布网站”选项。如果您右键单击它,它会询问您要在哪里/如何发布,并会为您处理其余的事情。我通常发布到我的文件系统上的一个文件夹,然后使用 FTP 上传站点,但也可以选择直接发布到 Web 服务器。
  • @ dash :我正在发布我的网站,就像这样,但它不会编译我的文件。为此,我必须手动使用 apsnet_compiler。
  • 运行发布时会发生什么?输出窗口中是否出现错误?您是否检查了项目属性以确保您正在构建解决方案中的所有属性?
  • @ dash :我没有收到任何错误。我截取了我的项目属性和发布窗口:abload.de/img/unbenanntui3ql.png(我有一个德国的 Visual Studio 安装)

标签: asp.net visual-studio-2010 web-site-project aspnet-compiler


【解决方案1】:

您可以使用Publish WebSite 向导 - 构建菜单 + 发布网站。查看 MSDN 文章 - How to: Deploy a Web Site Project by Using the Publish Web Site Tool。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2010-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多