Problem with application settings file

  • Thread starter Thread starter Andy Weedman
  • Start date Start date
A

Andy Weedman

I have two projects in a solution.

Project 1 is a user control. In this user control I define an application
setting to store a url the user control needs to talk to.

Project 2 is our flagship product which has a reference to project 1 and
uses the user control defined in project 1 on a form in project 2.

When I compile project 1 and look at the bin I see the .dll/.exe and most
importantly the project1.exe.config file which contains my application
settings.

When I compile project 2 and look at the bin I see the .dll for project1 but
no project1.exe.config file. I do see a project2.exe.config file but when I
look in it, the application setting from project 1 is not there.

When I run project 2 the user control doesn't work because it can't find the
application setting for the user control. I tried putting
project1.exe.config file in the bin folder for project 2 but again it didn't
work.

I hope this made sense. Let me know what you think. Thanks!
 
why not make a property for your user control for to store a url the user
control needs to talk to.??
 
I guess that is one solution...but I am implementing this control in several
applications and I didnt want to have to implement code to set the property
for the url in each application that implements the control.
 
If I'm reading correctly, you're asking where to put the configuration
file (dll.config) information for the .dll, right? I went through
this same issue a while ago - see http://tracyhunt.blogspot.com/2007/10/configuring-net-dll.html.

Nutshell: There is no config file for a .dll - you put all the .dll's
configuration information in the consuming application's config file.
There are some gotcha's, though, and the referenced post details how
to do it.

Regards,

Tracy
 
Back
Top