简体   繁体   English

将Web.Config加载为ASP.NET MVC中DLL中的嵌入式资源

[英]Load Web.Config as embedded resource inside a DLL in ASP.NET MVC

Following on from my earlier question around loading views from DLLs under ASP.NET MVC, I've come across the issue of having Views and Controls be strongly typed. 在我之前的有关在ASP.NET MVC下从DLL加载视图的问题之后,我遇到了使视图和控件具有强类型的问题。 An exception is thrown indicating that the type cannot be resolved. 引发异常,指示无法解析类型。

I found this article which describes implementing a web.config section which allows that strongly typed view declaration to be parsed correctly. 我发现这个文章描述实施web.config部分,它允许强类型的视图声明被正确解析。

How can I parse a web.config that is embedded in a class library as a resource? 如何解析作为资源嵌入在类库中的web.config? Would this require a custom build provider? 这是否需要自定义生成提供程序?

I think your confused? 我觉得你很困惑?

All you have to do is create a web.config file and put the code in the article you found in the folder where you are storing your views. 您所要做的就是创建一个web.config文件,并将代码放入您在存储视图的文件夹中找到的文章中。 Thats it. 而已。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM