【问题标题】:ASP.Net MVC 4 – Resource Cannot be found errorASP.Net MVC 4 – 找不到资源错误
【发布时间】:2014-05-05 06:40:01
【问题描述】:
我的项目直到昨天都运行良好,今天我将命名空间从 OnlineShoppingSystemMVC 重命名为 OnlineShoppingSystemMvc
然后我更改了 Global.asax 我更改的标记
<%@ Application
Codebehind="Global.asax.cs"
Inherits="OnlineShoppingSystemMvc.MvcApplication"
Language="C#" %>
但在调试应用程序时仍然会抛出资源找不到错误。
请帮我解决这个问题。
【问题讨论】:
标签:
asp.net-mvc
asp.net-mvc-4
global-asax
【解决方案1】:
你必须重命名所有
@model OnlineShoppingSystemMVC.YourModelsFolder.YourModel
到
@model OnlineShoppingSystemMvc.YourModelsFolder.YourModel 在您的所有查看文件中
现在我做了你之前做的事情(我重命名了我的一个项目的命名空间 (ctrl+R))并且所有命名空间都被重命名了,但是我的视图中模型的命名空间没有改变。
【解决方案2】:
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