<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Saving an embedded resource xml file at runtime in C#</title><link>http://weblogs.asp.net/cfrazier/archive/2005/07/18/419812.aspx</link><description>I couldn't find a cut &amp;amp; dry solution to this (probably b/c it's too simple for anyone to think they would need an example) so here's how I got an xml file embedded as a resource in a vs2003 project written to the filesystem. First, you just add an</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Saving an embedded resource xml file at runtime in C#</title><link>http://weblogs.asp.net/cfrazier/archive/2005/07/18/419812.aspx#7102695</link><pubDate>Sat, 30 May 2009 11:23:58 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7102695</guid><dc:creator>DigiMortal</dc:creator><author>DigiMortal</author><description>&lt;p&gt;You have to check if stream is null. Check out my version of embedded file reading &lt;a rel="nofollow" target="_new" href="http://weblogs.asp.net/gunnarpeipman/archive/2009/05/30/reading-embedded-files-at-runtime.aspx"&gt;weblogs.asp.net/.../reading-embedded-files-at-runtime.aspx&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7102695" width="1" height="1"&gt;</description></item><item><title>re: Saving an embedded resource xml file at runtime in C#</title><link>http://weblogs.asp.net/cfrazier/archive/2005/07/18/419812.aspx#5761191</link><pubDate>Mon, 11 Feb 2008 17:20:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5761191</guid><dc:creator>Max</dc:creator><author>Max</author><description>&lt;p&gt;It seems worth it to note that &amp;quot;doc.PreserveWhitespace = true;&amp;quot; should be placed before &amp;quot;doc.Load(rgbxml);&amp;quot;&lt;/p&gt;
&lt;p&gt;The apparent result, otherwise, is that the embedded file will get loaded, ignoring the whitespace, and then any whitespace left (which will likely be none) will be preserved.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5761191" width="1" height="1"&gt;</description></item><item><title>re: Saving an embedded resource xml file at runtime in C#</title><link>http://weblogs.asp.net/cfrazier/archive/2005/07/18/419812.aspx#420387</link><pubDate>Sun, 24 Jul 2005 12:33:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:420387</guid><dc:creator>Jason Haley</dc:creator><author>Jason Haley</author><description>Last year I put together an article that had a bunch of resource files related stuff in it, that people reading this entry might benefit from (some source code there too) at: &lt;a target="_new" href="http://www.jasonhaley.com/articles/resourcefiles/Resource%20Files.htm"&gt;http://www.jasonhaley.com/articles/resourcefiles/Resource%20Files.htm&lt;/a&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=420387" width="1" height="1"&gt;</description></item><item><title>re: Saving an embedded resource xml file at runtime in C#</title><link>http://weblogs.asp.net/cfrazier/archive/2005/07/18/419812.aspx#419819</link><pubDate>Mon, 18 Jul 2005 20:31:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:419819</guid><dc:creator>SteveF</dc:creator><author>SteveF</author><description>ah so like a standard template config file that applies to all new users .....this then gets saved per user and can be edited&lt;br&gt;Thanks Chris&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=419819" width="1" height="1"&gt;</description></item><item><title>re: Saving an embedded resource xml file at runtime in C#</title><link>http://weblogs.asp.net/cfrazier/archive/2005/07/18/419812.aspx#419815</link><pubDate>Mon, 18 Jul 2005 19:51:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:419815</guid><dc:creator>Chris Frazier</dc:creator><author>Chris Frazier</author><description>In this case, I believe that you have to recompile to get a new xml file in there. You may be able to get around it using satellite assemblies if you are worried about having to recompile.&lt;br&gt;&lt;br&gt;But this is a case that I have a default xml file that has the same content regardless of language, and it remains the same always. This is a good candidate for those cases.&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=419815" width="1" height="1"&gt;</description></item><item><title>re: Saving an embedded resource xml file at runtime in C#</title><link>http://weblogs.asp.net/cfrazier/archive/2005/07/18/419812.aspx#419813</link><pubDate>Mon, 18 Jul 2005 19:44:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:419813</guid><dc:creator>stevef</dc:creator><author>stevef</author><description>and are the new entries in the xml file available as an embedded resource. Do you not have to recompile the exe with the embedded resource?&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=419813" width="1" height="1"&gt;</description></item></channel></rss>