首页 > 解决方案 > 来自新项目的文件出现 404 错误

问题描述

我有几个项目的解决方案。其中一个项目是启动。它对其他项目的引用在引用中注册。我添加了一个新项目 Adkplatform.mrp.web (右键单击以在 Visual Studio 中添加一个新项目)。

我想在浏览器中显示一个测试页面。

对于 test.aspx 页面,我收到错误消息:

Server error in the application '/'. We could not find this resource. Description: http 404. probably, the resource (or one of its dependencies) is deleted, received a different name or temporarily unavailable. Review the following url and verify that it is entered correctly.

对于 test.html 页面,我收到错误:*

*Detailed Error Information:
Module     IIS Web Core
Notification       MapRequestHandler
Handler    StaticFile
Error Code     0x80070002
Requested URL      http://localhost:3333/test.html
Physical Path      D:\WORK\Projects\Test\Software\.Net\Test\test.html
Logon Method       Cookies*

我明白了,在启动项目中搜索文件。测试文件有 Build Action: Embedded Resource

我忘了做什么?提前谢谢。

标签: c#asp.netiis

解决方案


抱歉,问题出在我们的本地代码段中。显示器需要为每个程序集调用方法 c# HostingEnvironment.RegisterVirtualPathProvider。对于一个新项目(和新组件),它没有完成。


推荐阅读