HTTP错误404.0 - 未找到您要查找的资源已被删除 [英] HTTP Error 404.0 - Not Found The resource you are looking for has been removed

查看:325
本文介绍了HTTP错误404.0 - 未找到您要查找的资源已被删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有多个WAP,其中一个ASP MVC 3项目设置为启动项目。



每当我调试我的应用程序时,执行Application_Start()后的
Globals.asax内的事件

我得到

HTTP错误404.0 - 未找到

您要查找的资源已被删除,名称已更改或暂时不可用。



模块IIS Web核心

通知MapRequestHandler

处理程序StaticFile

错误代码0x80070002

请求的URL https:// localhost:443 / XYZAuthentication /?wa = wsignin1 .0&wtrealm = https%3a%2f%2flocalhost%2fXYZPortal%2fHome%2f&wctx = rm%3d0%26id%3dpassive%26ru%3d%252f&wct = 2015-03-16T09%3a16%3a23Z

物理路径C:\inetpub\wwwroot \XYZAuthentication \

登录方法匿名

登录用户匿名

解决方案

< blockquote>现在让我告诉你可能的因素这导致ASP.NET应用程序中的这404。第一个非常简单易懂,您的服务器上不存在文件或目录。我不认为这个需要进一步澄清。



其次,既然你在谈论ASP.NET MVC,你应该确保也启用了Url Routing。通过网址路由,您可以使用网站上的某些控制器创建逻辑映射,以允许自定义网址;未映射到服务器上的绝对路径的URL。因此,要么更改您尝试使用的URL,要么创建一个新的Controller并将其命名为 XYZAuthentication 。在你的RoutineConfig文件中,注册这个例程,



 route.MapRoute(
name: XYZAuthentication Route
url: {controller} / {action}
new {controller: XYZAuthentication,action: 注册}
);

// 如果您有行动登记





这样,您可以将URL映射到ASP.NET MVC应用程序中的实际Controller和Action。现在它不会抛出404,而是会在View中加载资源(可能是Action函数中的数据)。有关ASP.NET MVC框架的更多信息,请参阅本文 [ ^ ]。


Hi,
I got multiple WAP with an ASP MVC 3 project set as starting project.

Whenever i am debugging my Aplication,
after execution of "Application_Start()" Event inside Globals.asax
I am getting
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL https://localhost:443/XYZAuthentication/?wa=wsignin1.0&wtrealm=https%3a%2f%2flocalhost%2fXYZPortal%2fHome%2f&wctx=rm%3d0%26id%3dpassive%26ru%3d%252f&wct=2015-03-16T09%3a16%3a23Z
Physical Path C:\inetpub\wwwroot\XYZAuthentication\
Logon Method Anonymous
Logon User Anonymous

解决方案

Now let me tell you the possible factors that cause this 404 in ASP.NET applications. The first one is pretty much simple and easy to understand, the file or directory does not exist on your server. I don't think this one needs any more clarification.

Secondly, since you're talking about ASP.NET MVC, you should make sure that Url Routing is also enabled. Url routing lets you create logical mapping with some controllers on your website, to allow custom URLs; the URLs that do not map to an absolute path on your server. So, either change the URL you're trying to use, or create a new Controller and name it as XYZAuthentication. Inside your RoutineConfig file, register this routine,

route.MapRoute(
   name: "XYZAuthentication Route",
   url: "{controller}/{action}",
   new { controller: "XYZAuthentication", action: "register"}
);

// Provided that you're having an action register



This way, you can map your URL to an actual Controller and an Action in your ASP.NET MVC application. Now it won't throw 404, instead it would load the resources (probably the data inside your Action function) inside your View. For more on ASP.NET's MVC framework, please read this article[^] of mine.


这篇关于HTTP错误404.0 - 未找到您要查找的资源已被删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆