473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Problem with application settings file

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!
Aug 6 '08 #1
4 907
why not make a property for your user control for to store a url the user
control needs to talk to.??

"Andy Weedman" <An*********@discussions.microsoft.comwrote in message
news:C3**********************************@microsof t.com...
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!
Aug 6 '08 #2
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.

"Gillard" wrote:
why not make a property for your user control for to store a url the user
control needs to talk to.??

"Andy Weedman" <An*********@discussions.microsoft.comwrote in message
news:C3**********************************@microsof t.com...
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!

Aug 7 '08 #3
Andy Weedman wrote:
>

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.
Did you try putting a project1.dll.config there instead? Presumably project2
uses a dll version, not an exe version of project1. I'm pretty sure a dll.config
file will be successfully be read by a dll in the same folder.

Having said that, it makes sense to me for each app to configure the dll as
needed. Otherwise why is it a configuration setting in the first place?
Aug 7 '08 #4
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/1...g-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
Aug 7 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
1
by: Mevar | last post by:
Hello to everybody.I have a problem.I'm using an application configuration file to store particular settings.I use a custom Section Handler to read settings and everything work fine if I read my...
2
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
0
by: Nenad Dobrilovic | last post by:
Hi all, I have a really strange situation, but I believe that there is someone else who has already experinced the same, and is willing to help me! I made an application using VS 2005 in C#,...
0
by: james.mcdonagh | last post by:
Hi I am a newbie using nAnt for .net 2.0. As such I have not come across this bug before, and I would be happy of any help that you may be able to provide. In order to help I have included the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.