By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,871 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,871 IT Pros & Developers. It's quick & easy.

Why VS2005.IDE adds app.config to C# Class Library projects?

P: n/a

Hi,

As far as I know, a class library project cannot have any app.config
dedicated to itself and it always depends on the main application to provide
the .config settings.

Based on above, I am confused when I see that VS2005 adds an app.config file
upon I add a web service to my dll class library and stores the URL address
to the asmx file within that app.config file. Obviously that app.config file
is useless. Do I miss any best practices or this is a problem within visual
studio 2005 IDE?

Thank you,
Max

Oct 31 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello Maxwell2006,

MAs far as I know, a class library project cannot have any app.config
Mdedicated to itself and it always depends on the main application to
Mprovide the .config settings.

yep, but you can use Xml to open file manually and use it

MBased on above, I am confused when I see that VS2005 adds an
Mapp.config file upon I add a web service to my dll class library and
Mstores the URL address to the asmx file within that app.config file.
MObviously that app.config file is useless. Do I miss any best
Mpractices or this is a problem within visual studio 2005 IDE?

AFAIK, in this case App.config is not used at all, at least it works fine
where I met this

---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Oct 31 '06 #2

P: n/a
Hi Max,

The IDE adds an app.config file to the class library project to store the
URL for the web service in this case. When compiling the project, this URL
in the app.config file will be made as the default URL for the web service.

When you have a, for example, windows form app calling the class library,
and the web service has been moved. You can add the same key in the winform
app.config file, and the class library will then use the new URL instead of
the default one.

If anything is unclear, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.