1

I have a solution with 10+ web applications and a few class libraries. The web applications are modules of the same web site, so they run all in the same address, but in different physical folders. One of the web applications (the parent) holds the web.config file, the global.asax file, and a few necessary classes (the parent project is referenced).

If I publish the parent web application and a module web application to the IIS folder it works perfectly, but I can't debug the project locally because the child web application doesn't have a global.asax and web.config, so I need to copy then everytime I need to debug locally.

Is there a solution for this problem?

lolol
  • 4,287
  • 3
  • 35
  • 54
  • Why are they not all in the same project? – Bobson Jan 24 '13 at 19:09
  • Makes sense to our business model, keeping then in the same solution makes the solution a big mess (they are big modules installed separately to our clients). Transforming then in separated projects help us in so many ways that we not even consider putting then together again (free lancers just need to see a module to work, it is a lot more organized, and so on...) – lolol Jan 24 '13 at 19:12
  • That makes a lot of sense. – Bobson Jan 24 '13 at 19:17
  • No, I was serious. Those are some good reasons for wanting to keep them separate. – Bobson Jan 24 '13 at 19:28

1 Answers1

0

inheritInChildApplications=true

InheritInChildApplications attribute not recognized in web.config location element

http://www.kowitz.net/archive/2007/05/16/stopping-asp.net-web.config-inheritance

Avoid web.config inheritance in child web application using inheritInChildApplications

or maybe this is what you need Can a web.config read from an external xml file?

Community
  • 1
  • 1
Joe
  • 1,649
  • 12
  • 10
  • So If I put inheritInChildApplicationsattribute="false" in my web config my child web applications will not inherit my parent web.config. Ok, that is nice, but how can use this to solve my local deployment problem? Also, I have the same problem with the global.asax, everytime I want to debug a module I need to copy the parent web.config and global.asax to the module. – lolol Jan 24 '13 at 19:19
  • maybe I am misunderstanding a bit (sorry). you could do an xcopy of the configs from parent into child on debug build, and exclude those files in publish settings. – Joe Jan 24 '13 at 19:24
  • Don't worry, my english is not very good. I can solve the global.asax problem by creating a base class to inherit from in the child web applications, but the web.config problem is the same, I can't debug a child module without copying the parent web.config because the web.config isn't there at all. I can't external reference it also, there is nothing to reference if I don't copy it. – lolol Jan 24 '13 at 19:28
  • 1
    I would xcopy on build from the parent web.config into child so you always have latest and then through the properties of the web.config file (solution explorer) you can set the "Build Action" to "none". – Joe Jan 24 '13 at 19:49