Hi Michael,
As for the scenario you mentioned, I think the best approach is storing the
data into the built-in configuration section(such as AppSetting or a custom
config section). Thus, you can use .NET standard configuration API to load
it.
Since you want to separate the file, you can consider Mike's suggestion
about define a internal method which can programmtically generate a default
template(of that xml file). Thus, if the target application hasn't copied
the XML file(together with the dll), your internal method will autogenerate
one. For the template xml file, you can consider storing it in
dll/assembly's embeded resource:
#Understanding Embedded Resources in Visual Studio .NET
http://www.codeproject.com/KB/dotnet...resources.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 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. 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/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= <m_********@newsgroup.nospam>
Subject: multiple settings files
Date: Wed, 19 Nov 2008 19:38:00 -0800
>
I have created a class library (DLL) that requires a certain XML file in
the
>same directory as the DLL. This XML file is essentially a configuration or
settings file but I want it to be a separate file from the standard
user.config file. My attempts to do this did not yield what I needed:
(1) I first thought of just using a separate Settings object in my
project,
>but I observed that that simply inserts a separate section in user.config,
not a separate file as I require.
(2) I next tried just a plain XML file that I could read/write manually. I
could then add a post-build command to copy this file to the bin directory
when I create my DLL. That's fine for building the library itself but if I
add this library into another project as a reference how could I
automatically bring the XML file along as well?
Is there a different (better?) way to do something like this?