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.
精彩评论