ASP.Net MVC 4 - 无法找到资源错误

时间:2014-05-05 06:40:02

标签: asp.net-mvc asp.net-mvc-4 global-asax

我的项目工作正常,直到昨天,今天我将命名空间从 OnlineShoppingSystemMVC 重命名为 OnlineShoppingSystemMvc

然后我改变了Global.asax的标记我改变了

<%@ Application 
Codebehind="Global.asax.cs"
Inherits="OnlineShoppingSystemMvc.MvcApplication" 
Language="C#" %>

但是,当我调试应用程序时,仍然无法找到资源错误。

请帮助我解决这个问题。

2 个答案:

答案 0 :(得分:1)

您必须重命名所有

@model OnlineShoppingSystemMVC.YourModelsFolder.YourModel

所有View文件中的

@model OnlineShoppingSystemMvc.YourModelsFolder.YourModel

现在我做了你之前做过的事情(我重命名了我的一个项目的命名空间(ctrl + R))并重命名了所有命名空间但是模型&#39;我的视图中的命名空间没有改变。

答案 1 :(得分:1)

I find solution for your issue:

My project name is WebApplication1 after this rename it to WebApplication3 .

I was  change  this line in aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" **Inherits="WebApplication3.test"** %>
I done changes also in AssemblyInfo.cs :
**[assembly: AssemblyTitle("WebApplication3")]**
and **[assembly: AssemblyProduct("WebApplication3")]**

and also change in test.aspx.cs:

**namespace WebApplication3**

after this running project it works absolutely fine.
Hope it will help you