asp.net mvc - Can my project's Web.config manually inherit from another Web.config -


my settings

I am creating a base MVC project for several other MVC projects where all error handling And basic user recognition is located so I do not have to duplicate the boilerplate code in all other projects with the help of my favorite dependency injection container (go, go) I could put my code in the base project error codeontroller This is Being used by projects that it is the same custom user validation feature I've made.

I am using ASP.NET MVC4 targeting. NET4.0 with the following layout:

  MvcBase + - Controllers + - Error Controller CSS // General Error Controller + - Filter + - Authentication UserAutBribbut CS + - Application.cs // All MVC applications Base class + for - Web Configure // Base Configuration (*) MVC Project 1 + - View + - Error + - Index.cshtml + - Web.config MvcProject2 + - View + - Error + - Index.cshtml + - Web.config  

question

I know that Web.config s is inherited from the original directories, but is there a way to clearly specify the base config file Should that be obtained from this kind of configuration? It would be nice to be able to reference this (*) Web.config in my case, which is located at the hierarchical level similar to the other projects with Web.config . My use case is that I want to store some information in basic Web.config which is the same in all other projects (such as the configuration for error email) that I do not want to duplicate in the other < / P>

>

The way you configSource

Web.config

  & Lt; Connection Settings: ConfigSource = "bin / ConnectionStrings.config" & gt; & Lt; / ConnectionStrings & gt;  

Connection setting.Cong

  & lt; Connection best & gt; & Lt; Add ... / & gt; & Lt; / ConnectionsStrings & gt; After that, you can use the 'Add ...> Existing File' option to add these projects to other projects. After which you want to add the config file, click on the arrow instead, click the "Add" button and select "Add Link". This will make a visual link to the existing file instead of copying Visual Studio into the project. Then, any change is automatically linked to any project file. 


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -