什么是ASP.NET MVC4的错误? [英] What is error ASP.NET MVC4?

查看:76
本文介绍了什么是ASP.NET MVC4的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!我使用ASP.NET MVC4 C#。

我写了一个简单的源代码并尝试启动它并得到下一个错误:



服务器错误''/''申请。

----------------------------------- ---------------------------------------------



无法找到资源。

描述:HTTP 404.您要查找的资源(或其中一个依赖项)可能已被删除,名称已更改或暂时不可用。请查看以下网址,确保拼写正确。



请求的网址:/



你能告诉我,它是如何解决的?

解决方案



请指定您正在使用的环境。在vs中你需要检查global.asps.cs并设置启动哪个页面(默认页面),就像我们在普通的html中使用index.htm一样。它位于global.asps.cs的RegisterRoutes()中。

如果没有解决您的问题,您可以详细发布您的代码。



谢谢


尝试在web.config文件中将 relaxedUrlToFileSystemMapping 设置为 true

< pre lang =xml> < configuration >
< system.web >
< httpruntime relaxedurltofilesystemmapping = true / >
< / system.web >
< / configuration >







--Amit


Hello! I use ASP.NET MVC4 C#.
I wrote a simple source and try to start it and get next error:

Server Error in ''/'' Application.
--------------------------------------------------------------------------------

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /

Can you tell me, how it fix?

解决方案

hi,
please can you specify what environment you are using. in vs you need to check the global.asps.cs and set which page to start up(default page)like we use index.htm as default in normal html. It is in RegisterRoutes() of global.asps.cs
If is didn''t solved your problem, can you post your codes in detail.

thanks


Try setting relaxedUrlToFileSystemMapping to true in web.config file:

<configuration>
   <system.web>
    <httpruntime relaxedurltofilesystemmapping="true" />
   </system.web>
</configuration>




--Amit


这篇关于什么是ASP.NET MVC4的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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