[英]Can't find the Publish Website Option in Visual Studio 2012 Express Web
I created an Empty Website (not a project) using File > New Website > Aps.net Empty Web Site. 我使用文件>新网站> Aps.net空网站创建了一个空网站(不是项目)。 Usually when I click on Build, there is an option to "Publish Web Site". 通常,当我单击“生成”时,有一个“发布网站”选项。 However, I don't see it here. 但是,我在这里看不到它。 All I can see is build and rebuild solution. 我所看到的只是构建和重建解决方案。 What am I doing wrong? 我究竟做错了什么? Even when I right click on the website, it just gives me an option to Build, but not Publish. 即使我右键单击该网站,它也只是为我提供了“构建”选项,而不是“发布”选项。 I previously was using VS 2010, and it has the Publish option. 我以前使用的是VS 2010,它具有“发布”选项。
Publishing is only support for web application projects, not web site projects. 发布仅支持Web 应用程序项目,不支持网站项目。
http://msdn.microsoft.com/en-us/library/dd547590.aspx http://msdn.microsoft.com/en-us/library/dd547590.aspx
I don't know if this is true in all cases, but I just uninstalled VS 2012 Web Express, deleted the contents in the Microsoft Visual Studio 11 folder, and then installed the Professional version instead. 我不知道在所有情况下是否都如此,但是我只是卸载了VS 2012 Web Express,删除了Microsoft Visual Studio 11文件夹中的内容,然后安装了Professional版本。 Maybe the Express version doesn't have this, but after installing the Professional version, I do have the "Publish Web Site" option. 也许Express版本没有此功能,但是在安装Professional版本之后,我确实具有“发布网站”选项。
I believe this problem can be solved by downloading and installing the relevant Web Publish Update from this web page: http://msdn.microsoft.com/library/jj161045 我相信可以通过从以下网页下载并安装相关的Web发布更新来解决此问题: http : //msdn.microsoft.com/library/jj161045
I had the same problem in Visual Web Developer 2010 Express. 我在Visual Web Developer 2010 Express中遇到了相同的问题。 When I installed the update, the option to "Publish Web Site" became available to me. 当我安装更新时,“发布网站”的选项对我可用。
EDIT: You may find that when you click "Publish Web Site", you get an error like this: 编辑:您可能会发现当您单击“发布网站”时,会出现如下错误:
the imported project "C:\\ProgramFiles\\MSBuild\\Microsoft\\VisualStudio\\v11.0\\WebSites\\microsoft.website.publishing. targets" was not found. 找不到导入的项目“ C:\\ ProgramFiles \\ MSBuild \\ Microsoft \\ VisualStudio \\ v11.0 \\ WebSites \\ microsoft.website.publishing。目标”。 Confirm that the path in the declaration is correct, and that the file exists on disk. 确认声明中的路径正确,并且文件在磁盘上。
I solved this problem by going into "website.publishproj" (found in the Solution Explorer with my website open), and "hardwiring" the WebPublishTargetsVersion element like this: 我通过进入“ website.publishproj”(在打开我的网站的情况下在“解决方案资源管理器”中找到)并“硬接线” WebPublishTargetsVersion元素来解决此问题:
<WebPublishTargetsVersion>10.5</WebPublishTargetsVersion>
For some reason, the existing code was returning 11.0, instead of 10.5. 由于某种原因,现有代码返回的是11.0,而不是10.5。
Hardwiring it like this might cause problems later if you update your version. 如果更新版本,则像这样硬接线可能会在以后导致问题。 So do it with caution. 因此,请谨慎操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.