<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Deserializing data into a dynamically loaded Assembly</title>
	<atom:link href="http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/feed/" rel="self" type="application/rss+xml" />
	<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/</link>
	<description>A discursive take on the world around us</description>
	<lastBuildDate>Sun, 08 Nov 2009 08:36:27 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Carsten Lund Jørgensen</title>
		<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/#comment-143</link>
		<dc:creator>Carsten Lund Jørgensen</dc:creator>
		<pubDate>Sun, 31 May 2009 21:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://techdigger.wordpress.com/2007/12/22/derializing-data-into-a-dynamically-loaded-assembly/#comment-143</guid>
		<description>Thank you so very very much.

I had the exact same problem, and your solution just worked perfectly. You just saved my day :)</description>
		<content:encoded><![CDATA[<p>Thank you so very very much.</p>
<p>I had the exact same problem, and your solution just worked perfectly. You just saved my day <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pearl</title>
		<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/#comment-124</link>
		<dc:creator>Pearl</dc:creator>
		<pubDate>Fri, 24 Apr 2009 11:09:57 +0000</pubDate>
		<guid isPermaLink="false">http://techdigger.wordpress.com/2007/12/22/derializing-data-into-a-dynamically-loaded-assembly/#comment-124</guid>
		<description>Thankyou very much .............
APpreciated your solution it works fine;
Kind of you!!!!

Cheeeers</description>
		<content:encoded><![CDATA[<p>Thankyou very much &#8230;&#8230;&#8230;&#8230;.<br />
APpreciated your solution it works fine;<br />
Kind of you!!!!</p>
<p>Cheeeers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian Uifalean</title>
		<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/#comment-107</link>
		<dc:creator>Adrian Uifalean</dc:creator>
		<pubDate>Wed, 19 Nov 2008 13:22:23 +0000</pubDate>
		<guid isPermaLink="false">http://techdigger.wordpress.com/2007/12/22/derializing-data-into-a-dynamically-loaded-assembly/#comment-107</guid>
		<description>Thank&#039;s a lot; i have the same situation and this messege &quot;Unable to find assembly ...&quot; it drives me insane; the solution with SerializationBinder works fine;</description>
		<content:encoded><![CDATA[<p>Thank&#8217;s a lot; i have the same situation and this messege &#8220;Unable to find assembly &#8230;&#8221; it drives me insane; the solution with SerializationBinder works fine;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Balkany</title>
		<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/#comment-66</link>
		<dc:creator>Alan Balkany</dc:creator>
		<pubDate>Mon, 02 Jun 2008 15:43:42 +0000</pubDate>
		<guid isPermaLink="false">http://techdigger.wordpress.com/2007/12/22/derializing-data-into-a-dynamically-loaded-assembly/#comment-66</guid>
		<description>Wow, it worked!  For three days I&#039;ve been struggling to deserialize from a managed DLL.  I kept getting the error “Parse Error, no assembly associated with Xml key”.  Thanks!

Substituting your code for the SoapFormatter worked the first time.  I&#039;ve rearranged the code slightly to use any Stream:


        public static void serialize(Object o, Stream stream)
        {
            //MemoryStream stream = new MemoryStream();
            BinaryFormatter formatter = new BinaryFormatter();
            formatter.AssemblyFormat
                = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
            formatter.Serialize(stream, o);
            //return stream.ToArray();
        }


        public static Object binaryDeserialize(Stream stream)
        {
            //MemoryStream stream = new MemoryStream(bytes);
            BinaryFormatter formatter = new BinaryFormatter();
            formatter.AssemblyFormat
                = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
            formatter.Binder
                = new versionConfigToNamespaceAssemblyObjectBinder();
            Object obj = (Object)formatter.Deserialize(stream);
            return obj;
        }


        internal sealed class versionConfigToNamespaceAssemblyObjectBinder : SerializationBinder
        {
            public override Type BindToType(string assemblyName, string typeName)
            {
                Type typeToDeserialize = null;
                try
                {
                    string ToAssemblyName = assemblyName.Split(&#039;,&#039;)[0];
                    Assembly[] Assemblies = AppDomain.CurrentDomain.GetAssemblies();
                    foreach (Assembly ass in Assemblies)
                    {
                        if (ass.FullName.Split(&#039;,&#039;)[0] == ToAssemblyName)
                        {
                            typeToDeserialize = ass.GetType(typeName);
                            break;
                        }
                    }
                }

                catch (System.Exception exception)
                {
                    throw exception;
                }
                return typeToDeserialize;
            }
        }</description>
		<content:encoded><![CDATA[<p>Wow, it worked!  For three days I&#8217;ve been struggling to deserialize from a managed DLL.  I kept getting the error “Parse Error, no assembly associated with Xml key”.  Thanks!</p>
<p>Substituting your code for the SoapFormatter worked the first time.  I&#8217;ve rearranged the code slightly to use any Stream:</p>
<p>        public static void serialize(Object o, Stream stream)<br />
        {<br />
            //MemoryStream stream = new MemoryStream();<br />
            BinaryFormatter formatter = new BinaryFormatter();<br />
            formatter.AssemblyFormat<br />
                = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;<br />
            formatter.Serialize(stream, o);<br />
            //return stream.ToArray();<br />
        }</p>
<p>        public static Object binaryDeserialize(Stream stream)<br />
        {<br />
            //MemoryStream stream = new MemoryStream(bytes);<br />
            BinaryFormatter formatter = new BinaryFormatter();<br />
            formatter.AssemblyFormat<br />
                = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;<br />
            formatter.Binder<br />
                = new versionConfigToNamespaceAssemblyObjectBinder();<br />
            Object obj = (Object)formatter.Deserialize(stream);<br />
            return obj;<br />
        }</p>
<p>        internal sealed class versionConfigToNamespaceAssemblyObjectBinder : SerializationBinder<br />
        {<br />
            public override Type BindToType(string assemblyName, string typeName)<br />
            {<br />
                Type typeToDeserialize = null;<br />
                try<br />
                {<br />
                    string ToAssemblyName = assemblyName.Split(&#8216;,&#8217;)[0];<br />
                    Assembly[] Assemblies = AppDomain.CurrentDomain.GetAssemblies();<br />
                    foreach (Assembly ass in Assemblies)<br />
                    {<br />
                        if (ass.FullName.Split(&#8216;,&#8217;)[0] == ToAssemblyName)<br />
                        {<br />
                            typeToDeserialize = ass.GetType(typeName);<br />
                            break;<br />
                        }<br />
                    }<br />
                }</p>
<p>                catch (System.Exception exception)<br />
                {<br />
                    throw exception;<br />
                }<br />
                return typeToDeserialize;<br />
            }<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexandre</title>
		<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/#comment-17</link>
		<dc:creator>Alexandre</dc:creator>
		<pubDate>Thu, 13 Mar 2008 18:04:48 +0000</pubDate>
		<guid isPermaLink="false">http://techdigger.wordpress.com/2007/12/22/derializing-data-into-a-dynamically-loaded-assembly/#comment-17</guid>
		<description>This is great, very useful, exactly what I was looking for.</description>
		<content:encoded><![CDATA[<p>This is great, very useful, exactly what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohit Gupta</title>
		<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/#comment-15</link>
		<dc:creator>Mohit Gupta</dc:creator>
		<pubDate>Fri, 08 Feb 2008 21:25:56 +0000</pubDate>
		<guid isPermaLink="false">http://techdigger.wordpress.com/2007/12/22/derializing-data-into-a-dynamically-loaded-assembly/#comment-15</guid>
		<description>Excellent approach, Thanks.

But the DeSerialization fails if Generic Types are used. I posted some changes to the code that makes it work for Generic Types.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2816458&amp;SiteID=1&amp;mode=1</description>
		<content:encoded><![CDATA[<p>Excellent approach, Thanks.</p>
<p>But the DeSerialization fails if Generic Types are used. I posted some changes to the code that makes it work for Generic Types.</p>
<p><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2816458&amp;SiteID=1&amp;mode=1" rel="nofollow">http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2816458&amp;SiteID=1&amp;mode=1</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gops</title>
		<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/#comment-6</link>
		<dc:creator>gops</dc:creator>
		<pubDate>Sun, 23 Dec 2007 16:06:37 +0000</pubDate>
		<guid isPermaLink="false">http://techdigger.wordpress.com/2007/12/22/derializing-data-into-a-dynamically-loaded-assembly/#comment-6</guid>
		<description>Simply brilliant!</description>
		<content:encoded><![CDATA[<p>Simply brilliant!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ActiveEngine Sensei</title>
		<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/#comment-5</link>
		<dc:creator>ActiveEngine Sensei</dc:creator>
		<pubDate>Sun, 23 Dec 2007 16:04:52 +0000</pubDate>
		<guid isPermaLink="false">http://techdigger.wordpress.com/2007/12/22/derializing-data-into-a-dynamically-loaded-assembly/#comment-5</guid>
		<description>On a different note, TheCodeslinger has two posts related to Dynamic instantiation of objects that you might find interesting.  I posted these two links on my blog:

http://activeengine.wordpress.com/2007/12/04/new-blood-in-deadwood/

Enjoy!</description>
		<content:encoded><![CDATA[<p>On a different note, TheCodeslinger has two posts related to Dynamic instantiation of objects that you might find interesting.  I posted these two links on my blog:</p>
<p><a href="http://activeengine.wordpress.com/2007/12/04/new-blood-in-deadwood/" rel="nofollow">http://activeengine.wordpress.com/2007/12/04/new-blood-in-deadwood/</a></p>
<p>Enjoy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ActiveEngine Sensei</title>
		<link>http://techdigger.wordpress.com/2007/12/22/deserializing-data-into-a-dynamically-loaded-assembly/#comment-4</link>
		<dc:creator>ActiveEngine Sensei</dc:creator>
		<pubDate>Sun, 23 Dec 2007 16:02:48 +0000</pubDate>
		<guid isPermaLink="false">http://techdigger.wordpress.com/2007/12/22/derializing-data-into-a-dynamically-loaded-assembly/#comment-4</guid>
		<description>CLSA.Net has a nice DataPortal concept that allows you to copy objects via Web Services, remoting, and the MS Enterprise Services.  The solution is similar to what you have worked out here.

Here&#039;s a link to his site:

http://www.lhotka.net</description>
		<content:encoded><![CDATA[<p>CLSA.Net has a nice DataPortal concept that allows you to copy objects via Web Services, remoting, and the MS Enterprise Services.  The solution is similar to what you have worked out here.</p>
<p>Here&#8217;s a link to his site:</p>
<p><a href="http://www.lhotka.net" rel="nofollow">http://www.lhotka.net</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
