<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Changing dll settings without re-compiling</title>
	<atom:link href="http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/feed/" rel="self" type="application/rss+xml" />
	<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/</link>
	<description>A bunch of techy stuff we want to talk about</description>
	<pubDate>Sun, 01 Aug 2010 04:38:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Pablo Romano</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-54</link>
		<dc:creator>Pablo Romano</dc:creator>
		<pubDate>Thu, 22 Apr 2010 19:10:27 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-54</guid>
		<description>Hi Tejal, can you send me the web application to take a look at it?

Thanks,
Pablo</description>
		<content:encoded><![CDATA[<p>Hi Tejal, can you send me the web application to take a look at it?</p>
<p>Thanks,<br />
Pablo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tejal Bhavsar</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-53</link>
		<dc:creator>Tejal Bhavsar</dc:creator>
		<pubDate>Thu, 22 Apr 2010 11:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-53</guid>
		<description>Hi,

i have tried this code in my Window Application and it works properly but when try to add Reference in my web application it give me following error 

"The type initializer for 'DllWithSettings.SettingsConsumerClass' threw an exception."

i have checked all for thrice and everything is done as you said above.

Thanks,

Tejal.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>i have tried this code in my Window Application and it works properly but when try to add Reference in my web application it give me following error </p>
<p>&#8220;The type initializer for &#8216;DllWithSettings.SettingsConsumerClass&#8217; threw an exception.&#8221;</p>
<p>i have checked all for thrice and everything is done as you said above.</p>
<p>Thanks,</p>
<p>Tejal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Creepy Gnome</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-51</link>
		<dc:creator>Creepy Gnome</dc:creator>
		<pubDate>Mon, 22 Feb 2010 16:09:35 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-51</guid>
		<description>WoW, that is a lot of work for something that should be very simple.

For applications I use the app.config since it is provided, however for DLL's I have always justed used a simple XML File, and C# makes serializing to/from XML very easy.  Basically I just take a simple class with only public Properties and this is what becomes the XML file.  I then use a static util class that loads it up in its static constructor. Then you can just make the object available at anytime with the settings needed.

For a DLL I can see why it would care about User/Global settings, or why it should be so convoluted to store external data points for a DLL that change how it works.</description>
		<content:encoded><![CDATA[<p>WoW, that is a lot of work for something that should be very simple.</p>
<p>For applications I use the app.config since it is provided, however for DLL&#8217;s I have always justed used a simple XML File, and C# makes serializing to/from XML very easy.  Basically I just take a simple class with only public Properties and this is what becomes the XML file.  I then use a static util class that loads it up in its static constructor. Then you can just make the object available at anytime with the settings needed.</p>
<p>For a DLL I can see why it would care about User/Global settings, or why it should be so convoluted to store external data points for a DLL that change how it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dameon Black</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-48</link>
		<dc:creator>Dameon Black</dc:creator>
		<pubDate>Fri, 08 Jan 2010 21:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-48</guid>
		<description>The linked file method didn't seem to work.
Unless a prebuild script is added to copy the web.config over a dummy config file in the main project:

del  $(ProjectDir)web.config /F /Q
copy $(ProjectDir)..\\web.config $(ProjectDir)web.config /Y

This will force the deletion of any existing web.config file and copy the dlls config file over it.  
Will work even with source control.
I don't like it as it is confusing though.</description>
		<content:encoded><![CDATA[<p>The linked file method didn&#8217;t seem to work.<br />
Unless a prebuild script is added to copy the web.config over a dummy config file in the main project:</p>
<p>del  $(ProjectDir)web.config /F /Q<br />
copy $(ProjectDir)..\\web.config $(ProjectDir)web.config /Y</p>
<p>This will force the deletion of any existing web.config file and copy the dlls config file over it.<br />
Will work even with source control.<br />
I don&#8217;t like it as it is confusing though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo Romano</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-42</link>
		<dc:creator>Pablo Romano</dc:creator>
		<pubDate>Thu, 29 Oct 2009 19:25:34 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-42</guid>
		<description>Hi, you only need to change the .config file and restart (close and open) the application.
Try the example and please don't hesitate to ask again!</description>
		<content:encoded><![CDATA[<p>Hi, you only need to change the .config file and restart (close and open) the application.<br />
Try the example and please don&#8217;t hesitate to ask again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nuno Nogueira</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-41</link>
		<dc:creator>Nuno Nogueira</dc:creator>
		<pubDate>Thu, 29 Oct 2009 13:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-41</guid>
		<description>Who can I modify the DllWithSettings.config file and get the new properties values?

Thanks

Nuno</description>
		<content:encoded><![CDATA[<p>Who can I modify the DllWithSettings.config file and get the new properties values?</p>
<p>Thanks</p>
<p>Nuno</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonny</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-38</link>
		<dc:creator>Jonny</dc:creator>
		<pubDate>Tue, 13 Oct 2009 10:22:19 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-38</guid>
		<description>Great post, have been looking everywhere for a solution to the problem...

@Rolandas: I would really like to see an example on how to use linked config files. I tried google it and found an  element to add to the app.config file. But i didnt get the settings in my linked file to appear in my main settings file.</description>
		<content:encoded><![CDATA[<p>Great post, have been looking everywhere for a solution to the problem&#8230;</p>
<p>@Rolandas: I would really like to see an example on how to use linked config files. I tried google it and found an  element to add to the app.config file. But i didnt get the settings in my linked file to appear in my main settings file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo Romano</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-37</link>
		<dc:creator>Pablo Romano</dc:creator>
		<pubDate>Tue, 06 Oct 2009 17:17:26 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-37</guid>
		<description>Glad you liked it!, your approach is very interesting, didn't know about the existence of the linked config files, I will try it!</description>
		<content:encoded><![CDATA[<p>Glad you liked it!, your approach is very interesting, didn&#8217;t know about the existence of the linked config files, I will try it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rolandas Rudomanskis</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-36</link>
		<dc:creator>Rolandas Rudomanskis</dc:creator>
		<pubDate>Mon, 05 Oct 2009 20:13:39 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-36</guid>
		<description>Great solution, I almost came close to it, so you saved me time a bit :). Anyway, another aproach to not get "default" values is simply to add your app.config file of the dll project as a linked app.config to the main application, and change access modifier of the settings class in dll to public (available only VS 2008).  In that case every change in the settings file is reflected in app.config. You even can have multiple settings combined in one app.config from the different settings files. I came to the idea of creating a settings dll which can be included in various projects. And then configSource comes into play, when you can include only those settings you need, depending on the environment.</description>
		<content:encoded><![CDATA[<p>Great solution, I almost came close to it, so you saved me time a bit :). Anyway, another aproach to not get &#8220;default&#8221; values is simply to add your app.config file of the dll project as a linked app.config to the main application, and change access modifier of the settings class in dll to public (available only VS 2008).  In that case every change in the settings file is reflected in app.config. You even can have multiple settings combined in one app.config from the different settings files. I came to the idea of creating a settings dll which can be included in various projects. And then configSource comes into play, when you can include only those settings you need, depending on the environment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo Romano</title>
		<link>http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-re-compiling/#comment-35</link>
		<dc:creator>Pablo Romano</dc:creator>
		<pubDate>Fri, 25 Sep 2009 16:42:14 +0000</pubDate>
		<guid isPermaLink="false">http://moebiusit.com/blog/pabloromano/2009/07/13/changing-dll-settings-without-compiling/#comment-35</guid>
		<description>Yes, you are right, but that is a solution, not the only one.

This post explains another one that is more straight-forward, allow changes without re-compiling and doesn't require any post-build task (like the merge). Try the code and let me know what you think!</description>
		<content:encoded><![CDATA[<p>Yes, you are right, but that is a solution, not the only one.</p>
<p>This post explains another one that is more straight-forward, allow changes without re-compiling and doesn&#8217;t require any post-build task (like the merge). Try the code and let me know what you think!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
