<?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: UnauthorizedAccessException writing to HKLM</title>
	<atom:link href="http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/</link>
	<description>ASP.NET, HTML, CSS, Visual Studio, CSharp, VB.NET and other programming items of interest.</description>
	<pubDate>Tue, 06 Jan 2009 13:14:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: OJ</title>
		<link>http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-462</link>
		<dc:creator>OJ</dc:creator>
		<pubDate>Sat, 12 Apr 2008 11:10:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-462</guid>
		<description>I also hate apps that clutter up My Documents, especially when the stuff they store in there are not in any way a document! Application settings don't belong in My Documents.

Surely an application settings file that is stored somewhere in Isolated Storage would be the preferred option when using .NET? You don't have to worry about security, you can get per-user settings, and you don't have to worry about dealing with the registry at all.</description>
		<content:encoded><![CDATA[<p>I also hate apps that clutter up My Documents, especially when the stuff they store in there are not in any way a document! Application settings don&#8217;t belong in My Documents.</p>
<p>Surely an application settings file that is stored somewhere in Isolated Storage would be the preferred option when using .NET? You don&#8217;t have to worry about security, you can get per-user settings, and you don&#8217;t have to worry about dealing with the registry at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Serializable attribute vs Serializable Interface</title>
		<link>http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-427</link>
		<dc:creator>Serializable attribute vs Serializable Interface</dc:creator>
		<pubDate>Wed, 09 Apr 2008 12:12:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-427</guid>
		<description>[...] .NET AnswersASP.NET, HTML, CSS, Visual Studio, CSharp, VB.NET and other programming items of interest.         UnauthorizedAccessException writing to HKLM [...]</description>
		<content:encoded><![CDATA[<p>[...] .NET AnswersASP.NET, HTML, CSS, Visual Studio, CSharp, VB.NET and other programming items of interest.         UnauthorizedAccessException writing to HKLM [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-409</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 08 Apr 2008 16:25:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-409</guid>
		<description>Jibbers42,

You'll note I gave options on where to store the data.  Documents is just one possible location which may or may not be valid for your application.</description>
		<content:encoded><![CDATA[<p>Jibbers42,</p>
<p>You&#8217;ll note I gave options on where to store the data.  Documents is just one possible location which may or may not be valid for your application.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-408</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 08 Apr 2008 16:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-408</guid>
		<description>Yes, gmagana, you are both "kind of rough" AND not at all accurate.

If you implement serialization correctly my method works very well.  In fact, I used it on an active application.  You have to serialize the version of the object and account for it when you read, but that does not make the solution unworkable, nor does it make the post dumb or technically worthless.

Pull out your history book and look at the Archive method in MFC/C++ and you will find that this is EXACTLY how they dealt with this situation.  OK.. not everyone got the memo on this because I've seen some pretty serious inaccurate implementations.  But using a version identifier is the correct way to do this in both situations.

Of course, if all you do is apply the Serializable attribute, you are GOING to have BIG trouble.  But, that's not what I'm suggesting.  I'm suggesting IMPLEMENTING the Serializable interface which gives you a lot more control, and was specifically made for long term storage.

BTW, what do you think is happening when you save a Word, Excel, PowerPoint, etc document?  That's versioned object serialization happening there.  If serialization were such a huge problem, then I guess we'd have to store everything in a database.

Implementation using EITHER binary OR XML is completely valid depending on how accessible you want that data to be outside your application.  That is an implementation detail and you'll get yourself in trouble saying that it should ALWAYS be one or the other.</description>
		<content:encoded><![CDATA[<p>Yes, gmagana, you are both &#8220;kind of rough&#8221; AND not at all accurate.</p>
<p>If you implement serialization correctly my method works very well.  In fact, I used it on an active application.  You have to serialize the version of the object and account for it when you read, but that does not make the solution unworkable, nor does it make the post dumb or technically worthless.</p>
<p>Pull out your history book and look at the Archive method in MFC/C++ and you will find that this is EXACTLY how they dealt with this situation.  OK.. not everyone got the memo on this because I&#8217;ve seen some pretty serious inaccurate implementations.  But using a version identifier is the correct way to do this in both situations.</p>
<p>Of course, if all you do is apply the Serializable attribute, you are GOING to have BIG trouble.  But, that&#8217;s not what I&#8217;m suggesting.  I&#8217;m suggesting IMPLEMENTING the Serializable interface which gives you a lot more control, and was specifically made for long term storage.</p>
<p>BTW, what do you think is happening when you save a Word, Excel, PowerPoint, etc document?  That&#8217;s versioned object serialization happening there.  If serialization were such a huge problem, then I guess we&#8217;d have to store everything in a database.</p>
<p>Implementation using EITHER binary OR XML is completely valid depending on how accessible you want that data to be outside your application.  That is an implementation detail and you&#8217;ll get yourself in trouble saying that it should ALWAYS be one or the other.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jibbers42</title>
		<link>http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-407</link>
		<dc:creator>Jibbers42</dc:creator>
		<pubDate>Tue, 08 Apr 2008 15:54:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-407</guid>
		<description>Jesus gmagana, kinda rough, but valid.

I thought the same when I read about the serialized class suggestion, but forgot about it by the time he advocated cluttering my documents folder, lol.</description>
		<content:encoded><![CDATA[<p>Jesus gmagana, kinda rough, but valid.</p>
<p>I thought the same when I read about the serialized class suggestion, but forgot about it by the time he advocated cluttering my documents folder, lol.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jibbers42</title>
		<link>http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-406</link>
		<dc:creator>Jibbers42</dc:creator>
		<pubDate>Tue, 08 Apr 2008 15:46:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-406</guid>
		<description>Good post, right up until, "I prefer to store into the Document..."

I can't stand how much crap is stuffed into *My* Documents.  It's My Documents dammit, mine! It isn't Your Documents or Thier Documents. I guess in Vista it's just Documents, so maybe the ownership is up for debate, lol (actually all the folder name changes in Vista are great).

http://www.codinghorror.com/blog/archives/001032.html</description>
		<content:encoded><![CDATA[<p>Good post, right up until, &#8220;I prefer to store into the Document&#8230;&#8221;</p>
<p>I can&#8217;t stand how much crap is stuffed into *My* Documents.  It&#8217;s My Documents dammit, mine! It isn&#8217;t Your Documents or Thier Documents. I guess in Vista it&#8217;s just Documents, so maybe the ownership is up for debate, lol (actually all the folder name changes in Vista are great).</p>
<p><a href="http://www.codinghorror.com/blog/archives/001032.html" >http://www.codinghorror.com/blog/archives/001032.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gmagana</title>
		<link>http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-405</link>
		<dc:creator>gmagana</dc:creator>
		<pubDate>Tue, 08 Apr 2008 15:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dmbcllc.com/2008/04/08/unauthorizedaccessexception-writing-to-hklm/#comment-405</guid>
		<description>This is equivalent to saying "how do you fix this rendering problem in IE?  Use firefox."

A serialized class...  What happens to your data when, on a version upgrade, you change the structure of the class?  What happens when the .NET version changes?  In both cases, you cannot read the serialized class anymore. Your settings/data are lost.   The worst possible thing to do.  Serialization is not intended for long-term storage of data.

At least dig into the past and suggest INI files (which are quite appropriate for storing small amounts of configuration options or data sets).  Even using wordy-old XML is a better option that serialized-class binary files.

In C\C++, binary files saved to disk straight from structs were a pain in the ass to deal with in case of needing to change the underlying struct as part of a version upgrade for the exact same reason your suggestion here is a bad idea.</description>
		<content:encoded><![CDATA[<p>This is equivalent to saying &#8220;how do you fix this rendering problem in IE?  Use firefox.&#8221;</p>
<p>A serialized class&#8230;  What happens to your data when, on a version upgrade, you change the structure of the class?  What happens when the .NET version changes?  In both cases, you cannot read the serialized class anymore. Your settings/data are lost.   The worst possible thing to do.  Serialization is not intended for long-term storage of data.</p>
<p>At least dig into the past and suggest INI files (which are quite appropriate for storing small amounts of configuration options or data sets).  Even using wordy-old XML is a better option that serialized-class binary files.</p>
<p>In C\C++, binary files saved to disk straight from structs were a pain in the ass to deal with in case of needing to change the underlying struct as part of a version upgrade for the exact same reason your suggestion here is a bad idea.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
