[英]ASP.NET Deployment under IIS7/VS2010 as Web Application
I transformed my VS2008 ASP.NET Website to a "Web Application" today using VS2010. 我今天使用VS2010将我的VS2008 ASP.NET网站转换为“Web应用程序”。 So now it's possible to build a Deployment Package.
所以现在可以构建一个部署包。 A Zip Package which can be direclty imported into IIS7.
一个Zip包,可以直接导入IIS7。
Usually I added a website in IIS7 called mydomain.com and put everything in its root dir. 通常我在IIS7中添加了一个名为mydomain.com的网站,并将所有内容放在其根目录中。 That worked.
那很有效。
However, since I converted to an Web Application, this Application is added beneath my "Website container". 但是,自从我转换为Web应用程序后,此应用程序被添加到我的“网站容器”下面。 Now I'm confused, this is how it actually looks now when I try to open the website:
现在我很困惑,这是我尝试打开网站时的实际情况:
Browsing to mydomain.com says 404 ERROR. 浏览mydomain.com说404 ERROR。
Browsing to mydomain.com/mydomain.com opens the actual website, but in a subfolder instead of the root directory. 浏览到mydomain.com/mydomain.com会打开实际的网站,但会在子文件夹中而不是根目录中。 (The Application is named after the Domain)
(应用程序以域名命名)
How to make this application the root of the website now? 如何使这个应用程序成为网站的根目录? I want the application to run under the mydomain.com ROOT and not some subfolder.
我希望应用程序在mydomain.com ROOT下运行而不是某些子文件夹。
Thanks a lot! 非常感谢!
In VS 2010, right click your project and go to Package/Publish settings
.. In there, down below, in the Web Deployment Package settings
, there's a IIS Web site/application name
field. 在VS 2010中,右键单击您的项目并转到
Package/Publish settings
。在下面的Web Deployment Package settings
,有一个IIS Web site/application name
字段。
It seems that it's currently set to mydomain.com/mydomain.com
or something similar. 它似乎已设置为
mydomain.com/mydomain.com
或类似的东西。 Change it to mydomain.com
and it should work as expected. 将其更改为
mydomain.com
,它应该按预期工作。
Second thing to check is your Publish settings (VS menu Build -> Publish "websitename"
). 要检查的第二件事是你的发布设置(VS菜单
Build -> Publish "websitename"
)。 Check the Site/application field. 检查站点/应用程序字段。 Set it to
mydomain.com
as well, make sure it doesn't have any slashes. 将它设置为
mydomain.com
,确保它没有任何斜杠。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.