ASP MVC3需要Webmatrix吗?

时间:2010-12-30 19:23:23

标签: asp.net-mvc webmatrix

我刚刚启动了一个用MVC2编写的旧项目......

只有少量前端启动,所以我决定使用MVC3和Razor视图引擎。我创建了一个简单的控制器和视图,然后在Cassini中查看该网站,但它只是一直告诉我:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 22:     using System.Web.WebPages;
Line 23:     using System.Web.WebPages.Html;
Line 24:     using WebMatrix.Data;
Line 25:     using WebMatrix.WebData;
Line 26:    

Source File: c:\Users\XXXXXX\AppData\Local\Temp\Temporary ASP.NET Files\root\ecf08653\deea7194\App_Web_index.cshtml.e70a5900.x4np9ici.0.cs    Line: 24 

据我所知,WebMatrix只是一堆IIS / Sql Server和其他一些我不感兴趣的gubbins。我没有明确安装WebMatrix(除非它捆绑在MVC3安装程序中,即便如此我也找不到它在我的硬盘上。)

我已经完成了我的项目并删除了我可以找到的任何和所有WebMatrix的痕迹并清除了ASP临时文件,但它一直在抱怨,所以我想知道他们是否已经让MVC依赖于某些Web矩阵功能?

2 个答案:

答案 0 :(得分:3)

Razor是WebMatrix软件包的一部分,MVC 3完全依赖于ASP.NET Web页面框架。 WebMatrix.WebData包含SimpleMembershipProvider,并且依赖于WebMatrix.Data。您使用的是哪个版本的MVC3?不是RC2?如果是,请参阅此主题:asp.net MVC webmatrix membershipprovider kicking in

答案 1 :(得分:1)

此外,如果您安装Visual Studio 11开发人员预览版,它将会杀死VS2010中的MVC Razor。

CTP似乎是关键因素,因为任何版本的Async CTP也会杀死MVC Razor。 因此,任何MS CTP预览都需要在VMWare或PC-VM会话中,因为回到原来所需的时间比安装Visual Studio 11 Developer Preview或Async CTP要长。看到错误是一致的,似乎是什么4.5当你从C#4.0迁移到C#5.0并且Visual Studio 11不可能在2012年11月之前出现时,.NET将会变得非常不同。