简体   繁体   中英

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. 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.

在此处输入图片说明

Publishing is only support for web application projects, not web site projects.

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. Maybe the Express version doesn't have this, but after installing the Professional version, I do have the "Publish Web Site" option.

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

I had the same problem in 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. 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:

<WebPublishTargetsVersion>10.5</WebPublishTargetsVersion>

For some reason, the existing code was returning 11.0, instead of 10.5.

Hardwiring it like this might cause problems later if you update your version. So do it with caution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM