c# - 来自新项目的文件出现 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# HostingEnvironment.RegisterVirtualPathProvider。对于一个新项目(和新组件),它没有完成。
推荐阅读
- java - Spring boot + Spring mail:标准{PORT}问题
- git - git:如何在不丢失历史的情况下将旧的标记版本变为 master?
- reactjs - 我无法从 Google api 设置 locg 变量的状态。我需要从 Google API 获取多个位置的纬度和经度
- game-maker - 我需要游戏制作者 2.3 的帮助
- php - 如何在php中显示博客文章的mysql中保存的类别?
- iframe - Electron webContents.printToPDF 不适用于包含 iframe 的网页
- python - 如何用现有的分片 tfrecords 替换 tfds 数据集
- nestjs - 我在nestjs-redis中使用configService时出错,就像在文档中一样
- javascript - Internet 日期和时间格式到 Unix 时间戳,反之亦然
- reactjs - 由于 useState,React Native 中的无限循环