禁用 Visual Studio Web 服务器目录浏览

发布于 2024-07-25 22:27:49 字数 891 浏览 8 评论 0原文

我正在使用 Visual Studio 的内置 Web 服务器来测试 EPiServer 应用程序。 当我在 IIS 中运行应用程序时,如果我点击虚拟目录的根目录,EPiServer 将接管并向我提供默认页面。 使用 Visual Studion 服务器(我出于许可证原因使用 SDK 这样做),它总是为我提供站点的“目录列表”视图。 有谁知道如何配置此网络服务器以不允许目录列表/浏览?

其他信息: 这个问题似乎只影响 Visual Studion Web 服务器的根(我从这里开始将其称为 cassini)。 举个例子,如果我从 localhost:6666 运行一个站点,那么我会发现 localhost:6666/en/ 会正常工作,并且 EPiServer VPP 会知道它在做什么。 如果我使用 localhost:6666/,那么 VPP 永远不会启动(或者看起来如此)。 在我看来,当卡西尼的根被击中时,它会检查该页面是否存在(它不存在,因为我没有默认值)。 如果它确定该页面不存在,那么它会提供目录列表,而不是 404。我要做的第一件事是在 cassini 中禁用目录浏览,然后查看为什么 VPP 没有正确运行。

所以我想问题的基础是:当 Visual Studio 启动一切时,是否有办法修改 Cassini 中的这些设置?

(EPiServer 可能是一个转移注意力的东西,但为了以防万一,它是 CMS 版本 5)

进一步更新 我设法找到了 Cassini 3.5 的源代码并尝试了一下。 3.5 工作正常,在本例中的行为类似于 IIS。 即,缺少默认文档不会导致目录列表,而是如果允许 HTTP 处理程序启动,然后 EPiServer 会完成其余的工作! 所以问题是,我可以在 Web 服务器上的 Visual Studio 中实现同样的效果吗?

I'm using Visual Studio's built in web server to test and EPiServer applicaiton. When I have the app running in IIS, if I hit the root of the virtual directory, EPiServer will take over and server the defaul page to me. Using the Visual Studion server (which I am doing for license reasons with the SDK), it always gives me the 'Directory Listing' view of my site. Does anyone know how to configure this web server to not allow the directory listing/browsing?

Additional Information:
This problme only seems to effect the root of the visual studion web server (i'll call it cassini from here on in). As an example, if I run a site from localhost:6666, then what I will find is that localhost:6666/en/ will work just fine and the EPiServer VPP will know what it is doing. If I use localhost:6666/, then the VPP never kicks in (or so it seams). It seems to me that when the root of cassini is hit, it checks to see if the page exists (which it does not as I have no default). If it decides that the page does not exist, then it serves up the directory listing, rather than 404. The first thing to do for me is to dispable directory browsing in cassini, then look at why the VPP is not being actioned correctly.

So I suppose the base of the question is: Is there a way to modify these settins in Cassini when it is Visual Studio starting everything off?

(EPiServer may be a red herring, but just in case, it's CMS version 5)

Further Update
I managed to get hold of the source for Cassini 3.5 and gave that a whirl. 3.5 works just fine and behaves like IIS in this instance. I.e. the lack of default document does not lead to a Directory listing, rather if allows the HTTP handlers to kick in and then EPiServer does the rest! So the question is, can I achieve the same in Visual Studios effort at a web server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

悲歌长辞 2024-08-01 22:27:49

确保您有 ~/Default.aspx 文件。 它不会渲染,但 cassini 中需要它,以便虚拟路径提供程序有机会处理“/”的请求。
当然,如果你无论如何都做到了,你也可以将它用于起始页:-)

Make sure you have a ~/Default.aspx file. It won't render, but it's needed in cassini for the virtual path providers to get a chance to handle the request for '/'.
Of course, if you make it anyway you might as well use it for the start page :-)

北方的巷 2024-08-01 22:27:49

即使您可以让服务器不显示目录列表,您可以让 EPiServer 接管吗?


编辑:来自评论
它与 /en/ 一起使用的事实让我认为这是微软可以解决的问题。 建议您询问供应商是否有解决方法。 如果不这样做,请在 http://connect.microsoft.com/visualstudio/。 请务必指定有关 EPIServer、供应商 URL 等的详细信息。请明确

它与 /en 一起使用,但您需要一个设置允许它在根目录下工作。

创建建议后,请编辑您的问题以包含指向您创建的建议的链接。 这样,其他阅读您问题的人就可以投票决定他们认为这有多重要。

Even if you could get the server to not show the directory listing, could you get EPiServer to take over?


EDIT: From comments
The fact that it works with /en/ makes me think this is something that Microsoft could fix. I suggest you ask the vendor if they have a workaround. If they do not, then please create a suggestion at http://connect.microsoft.com/visualstudio/. Be sure to specify details about EPIServer, URL to the vendor, etc.

Be clear that it works with /en, but you want a setting permitting it to work at the root.

Once you create the suggestion, please edit your question to include the link to the suggestion you create. That way, others reading your question can vote on how important they think this is.

吹泡泡o 2024-08-01 22:27:49

EpiServer 部分让我感到困惑。 但是,如果您询问如何设置 VS 开发服务器的默认页面(基于 Cassini 代码),则需要在项目属性(右键单击 Web 项目)、Web、启动操作、特定中执行此操作页面,foo.aspx。

我怀疑cassini/VS开发服务器没有默认页面功能——cassini服务器(VS开发服务器的祖先)的源代码 位于网络上,您可以检查并通过构建自定义版本来添加默认页面。 而且它没有 IIS 所具有的其他功能的很长的列表。

The EpiServer part confuses me. However, if you are asking how to set the default page for the VS development server (based on the Cassini code), you're expected to do that in the project properties (right click on web project), Web, Start Action, Specific Page, foo.aspx.

I suspect the cassini/VS development server doesn't have a default page feature-- the source code for the cassini server (the ancestor of the VS development server) is on the web and you can check that and add a default page by building a custom version. And it doesn't have a very long list of other features that IIS has.

樱&纷飞 2024-08-01 22:27:49

您运行的是哪个 EPiServer 版本?
您是使用 EPiServer Manager 安装的吗?

在主机名的根目录或作为(虚拟)目录运行站点之间的配置始终存在一些差异。

检查 web.config 中的站点设置块,并确保项目根目录中有一个 default.aspx。

Which EPiServer version are you running?
Did you install it using EPiServer Manager?

There has always been some differences in the configuration between running the site at the root of a host name or as a (virtual) directory.

Check the site settings block in web.config and make sure you have a default.aspx at the project root.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文