相关疑难解决方法(0)

如何为MVC-3-converted-to-4 app添加对System.Web.Optimization的引用

我正在尝试在我最近从MVC 3转换为MVC 4 beta的项目中使用新的捆绑功能.它需要global.asax中的一行代码BundleTable.Bundles.RegisterTemplateBundles();,这需要using System.Web.Optimization;在顶部.

当我这样做时,我得到了红色的波浪形线条,上面写着:"你错过了一个装配参考吗?" 当我尝试添加引用,并单击对话框中的.NET选项卡时,从AZ排序,我没有看到System.Web.Optimization.

如何将此ref添加到我的项目中?谢谢.

namespaces asp.net-mvc-4 asp.net-optimization

455
推荐指数
6
解决办法
37万
查看次数

名称空间"System.Web"中不存在类型或命名空间名称"优化"

我正在部署一个新网站作为我的主要网站,它的工作非常精彩.

根网址下的所有应用程序都可以正常工作,除了一个.它是一个遗留系统(c#.net),使用频繁,遗憾的是,我无法访问源代码.

当我运行遗留应用程序www.mysite.com/crm时,出现以下错误:

Server Error in '/crm' Application.

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: CS0234: The type or namespace name 'Optimization' does not 
exist in the namespace 'System.Web' (are you missing an assembly reference?)

Source Error:


Line 17:     <pages>
Line 18:       <namespaces>
Line 19:         <add namespace="System.Web.Optimization" />
Line 20:       </namespaces>
Line 21:     <controls> …
Run Code Online (Sandbox Code Playgroud)

.net html c#

31
推荐指数
4
解决办法
5万
查看次数