Web.config in subfolder

I am trying to install an application inside another web application. I have my .aspx pages and some code that I put in the main app_code folder of the application. I added my own web.config file for my connection string and so on, but I think there is a conflict. So my question is two parateres. Firstly, what is the best way to install the application inside another application, i.e. I have to use the main app_code folder of the applications or add my own, and secondly, there will be a conflict with the two web.config files. I was under the impression that the files were pulled from the very specific web.config file. It looks like there is a problem with my security and I cannot access my file. I attributed this to two web.config files,

thank.

+1


source to share


2 answers


If the attached application has turned its folder into an application (right click on it in IIS, properties and in the Application tab Create new application), you should put the code in your local App_Code folder:

- \RootFolder        // Root of website
|-  \App_Code        // App_Code at root
|-  \NewApplication  // Seperate application in IIS, has "web in a box" icon in IIS
| |-  \App_Code      // App_Code of new application

      

If the attached application is not a true application (in the IIS sense), then you will need to have the code files in the root App_Code folder.



This also affects your web.config - if the nested application is a true application, then you should be able to have the complete web.config at the right level, but if it is not an IIS application, then there are restrictions on what you can put in subsequent web.configs - some elements are allowed only in the web.config file in the root of the application and cannot be overridden by other settings.

What actual error are you seeing?

+1


source


As for your first question, I would prefer that they be deployed to a different folder. Second, if you have, for example, a website inside the default website, you will have a web.config as well, but the more specific one will override some web.config attributes from the default website, but those that not overridden will be there (i.e. HTTPHandlers, HTTPModules, the site will try to load them, so you will need to add a remove tag inside HttpModules to remove them).



Hope this clarifies your question.

+1


source







All Articles