开发者

How to get reference for namespace Microsoft.WebPages.Compilation

开发者 https://www.devze.com 2023-02-06 05:25 出处:网络
I am developing MVC 3 web application. According to some articles, we can register global namespaces by CodeGeneratorSettings.AddGlobalImport function.Here is one link.

I am developing MVC 3 web application. According to some articles, we can register global namespaces by CodeGeneratorSettings.AddGlobalImport function.Here is one link.

But the problem is I can not 开发者_StackOverflow中文版use CodeGeneratorSettings class in my app, can not find any references for it. Have it already been depreciated?

I have Webmatrix 1.0 installed, but it does not help.

Any help is appreicated.


The method has been moved to the following namespace

System.Web.WebPages.Razor.WebCodeRazorHost.AddGlobalImport("Your namespace");

I would recommend using the web.config method however as there would only be one place in your code to add/remove namespaces.

0

精彩评论

暂无评论...
验证码 换一张
取 消