简体   繁体   English

IIS中的Web应用程序未获取正确的根目录

[英]Web application in IIS not picking up the correct root

I don't know if I'm doing something very obvious incorrectly, but for some reason my web app thinks that it's root folder is different to what it actually is. 我不知道我是否在做一些非常明显的错误操作,但是由于某种原因,我的Web应用程序认为它的根文件夹与实际的文件夹不同。

I have created a web application below Default Web Site. 我已经在“默认网站”下创建了一个Web应用程序。 Whenever I have done this in the past, and understanding of how it's supposed to work, is that any requests to the application root (for URL routing, for example ~/index.aspx or for images) have always resolved to [server][applicationname]\\index.aspx. 过去无论何时,只要对应用程序根目录的任何请求(用于URL路由,例如〜/ index.aspx或图像),都应该始终解析为[server] [应用程序名称] \\ index.aspx。

For some reason, whenever I do this with this particular application, instead of going to [server][applicationname]\\index.aspx, I'm being redirected to [server]\\index.aspx, and for the life of me, and after extensive googling and fiddling with settings, I can't get it to pick up the correct path. 由于某种原因,每当我使用此特定应用程序执行此操作时,就不再转到[server] [applicationname] \\ index.aspx,而是重定向到[server] \\ index.aspx,这对我来说是一生,并且经过大量的搜索和摆弄设置后,我无法选择正确的路径。

Any suggestions? 有什么建议么?

When you go to your site in II7, first make sure your site is highlighted. 当您在II7中转到站点时,请首先确保站点已突出显示。 Then click Basic Settings on the right hand side. 然后单击右侧的基本设置。 Double check the Physical Path in the popup window. 在弹出窗口中仔细检查“物理路径”。

Well, I don't know what the problem was, but after restarting the website it seemed to go away and is now working as expected. 好吧,我不知道问题出在哪里,但是在重新启动网站之后,它似乎消失了,并且现在可以正常运行。 It's possible that it was caused by the application previously being a web site, and then I converted it to a web app without restarting it, although I did recycle the app pool. 这可能是由于该应用程序以前是网站引起的,然后我将其转换为Web应用程序而没有重新启动它,尽管我确实回收了应用程序池。

Cheers for the comments - I'll leave this as the answer in case someone has a similar problem in future. 为评论加油-如果将来有人遇到类似问题,我将以此为答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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