Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dll and webconfig question

Status
Not open for further replies.

toptomato

Programmer
Jul 22, 2005
62
US
Hi guys here is fun one.
so i have this project called ProjectA which reference another project called ProjectB. Now just to make it clear in visual studio 2003 I went to ProjectA, right clicked on references folder and clicked add a reference, clicked on the project tab and choose ProjectB, clicked 'select' thus adding ProjectB as a reference to ProjectA.

Now this ProjectA get distributed to clients. Now the delima is that ProjectB has in its webconfig an entry, lets call it 'color' which is set to 'blue'. Now is it possible to change the 'color' through a webconfig entry in ProjectA after being distributed to clients. After being distributed to clients the project can no longer be complied because they only get the *.aspx, *.ascx, web.config and *.dll files.

What if we also distribute ProjectB (compiled - just the *.aspx, *.ascx, web.config, *.dll) along with ProjectA. Can we then change the color just by changing the color entry of the ProjectB's webconfig file.
 
I think as long as they both use the same web.config then you will be able to get at the color in both applications?

I think the main concern is how the projects are physically laid out in IIS, sicne they will use the Web.config that is closest to them.

Or I completely misunderstood your question... :)

-FD
 
You can only configure/ deploy one web.config file per directory/sub-directory, but what you put in it is your business.

If you want ProjectA's appSettings to have an element with color "blue" just configure it as such, it doesn't matter what the web.config value was in ProjectB because the web.config file is read at run-time not compiled into the assembly.

That said, if you're adding references to different web applications, you may want to consider stripping the shared code out into a class library, then referencing it from both applications. Two independent web apps really shouldn't reference each other.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top