<?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/"
> <channel><title>Comments on: The Known Type Provider</title> <atom:link href="http://davybrion.com/blog/2008/07/the-known-type-provider/feed/" rel="self" type="application/rss+xml" /><link>http://davybrion.com/blog/2008/07/the-known-type-provider/</link> <description>inquisitive: adjective. given to inquiry, research, or asking questions; eager for knowledge; intellectually curious</description> <lastBuildDate>Sun, 20 May 2012 21:55:00 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/07/the-known-type-provider/comment-page-1/#comment-38837</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Tue, 11 May 2010 13:02:52 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=193#comment-38837</guid> <description>@Tijuyou should probably contact the NServiceBus group for this...</description> <content:encoded><![CDATA[<p>@Tiju</p><p>you should probably contact the NServiceBus group for this&#8230;</p> ]]></content:encoded> </item> <item><title>By: Tiju John</title><link>http://davybrion.com/blog/2008/07/the-known-type-provider/comment-page-1/#comment-38836</link> <dc:creator>Tiju John</dc:creator> <pubDate>Tue, 11 May 2010 13:01:08 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=193#comment-38836</guid> <description>Hi,for the context setting, I am exchanging messages between my nServiceBus client and nSerivceBus server. its is the namespace xyz.Messages and and a class, Message : IMessageI have more messages that are in the other dlls, like xyz.Messages.Domain1, xyz.Messages.Domain2, xyz.Messages.Domain3.
and messages that derive form that base message, Message.I have the endpoints defined as like :at clientat Serverand the bus initialized asIBus serviceBus = Configure.With()
.SpringBuilder()
.XmlSerializer()
.MsmqTransport()
.UnicastBus()
.LoadMessageHandlers()
.CreateBus()
.Start();now when i try sending instance of Message type or any type derived types of Message, it successfully sends the message over and at the server, i get the proper type.eg.Message message= new Message();
Bus.Send(message); // works fine, transfers Message type
message = new MessageDerived1();
Bus.Send(message); // works fine, transfers MessageDerived1 type
message = new MessageDerived2();
Bus.Send(message); // works fine, transfers MessageDerived2 typeMy problem arises when any type, say MessageDerived1, contains a member variable of type Message, and when i assign it to a derived type, the type is not properly transferred over the wire. It transfers only as Message type, not the derived type.public class MessageDerived2 : Message
{
public Message;
}MessageDerived2 messageDerived2= new MessageDerived2();
messageDerived2.Message = new MessageDerived1();
message = messageDerived2;
Bus.Send(message); // incorrect behaviour, transfers MessageDerived2 correctly, but looses type of  MessageDerived2.Message (it deserializes as Message type, instead of MessageDerived1)any help is strongly appreciated.Thanks
TJ</description> <content:encoded><![CDATA[<p>Hi,</p><p>for the context setting, I am exchanging messages between my nServiceBus client and nSerivceBus server. its is the namespace xyz.Messages and and a class, Message : IMessage</p><p>I have more messages that are in the other dlls, like xyz.Messages.Domain1, xyz.Messages.Domain2, xyz.Messages.Domain3.<br
/> and messages that derive form that base message, Message.</p><p>I have the endpoints defined as like :</p><p>at client</p><p>at Server</p><p>and the bus initialized as</p><p> IBus serviceBus = Configure.With()<br
/> .SpringBuilder()<br
/> .XmlSerializer()<br
/> .MsmqTransport()<br
/> .UnicastBus()<br
/> .LoadMessageHandlers()<br
/> .CreateBus()<br
/> .Start();</p><p>now when i try sending instance of Message type or any type derived types of Message, it successfully sends the message over and at the server, i get the proper type.</p><p>eg.</p><p>Message message= new Message();<br
/> Bus.Send(message); // works fine, transfers Message type<br
/> message = new MessageDerived1();<br
/> Bus.Send(message); // works fine, transfers MessageDerived1 type<br
/> message = new MessageDerived2();<br
/> Bus.Send(message); // works fine, transfers MessageDerived2 type</p><p>My problem arises when any type, say MessageDerived1, contains a member variable of type Message, and when i assign it to a derived type, the type is not properly transferred over the wire. It transfers only as Message type, not the derived type.</p><p>public class MessageDerived2 : Message<br
/> {<br
/> public Message;<br
/> }</p><p>MessageDerived2 messageDerived2= new MessageDerived2();<br
/> messageDerived2.Message = new MessageDerived1();<br
/> message = messageDerived2;<br
/> Bus.Send(message); // incorrect behaviour, transfers MessageDerived2 correctly, but looses type of  MessageDerived2.Message (it deserializes as Message type, instead of MessageDerived1)</p><p>any help is strongly appreciated.</p><p>Thanks<br
/> TJ</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2008/07/the-known-type-provider/comment-page-1/#comment-1198</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Sun, 17 Aug 2008 17:46:57 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=193#comment-1198</guid> <description>I actually have the KnownTypeProvider in a library (Brion.Library) which is referenced by my application.In my application code, before i start hosting the service i do the following:&lt;code&gt;
&lt;div style=&quot;font-family: Consolas; font-size: 10pt; color: black; background: white;&quot;&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;span style=&quot;color: #2b91af;&quot;&gt;KnownTypeProvider&lt;/span&gt;.RegisterDerivedTypesOf&lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Request&lt;/span&gt;&gt;(sharedAssembly);&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;span style=&quot;color: #2b91af;&quot;&gt;KnownTypeProvider&lt;/span&gt;.RegisterDerivedTypesOf&lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Response&lt;/span&gt;&gt;(sharedAssembly);&lt;/p&gt;
&lt;/div&gt;
&lt;code&gt;If i start hosting the service and i try to generate a proxy with SvcUtil, all of the known types in my application&#039;s library are present in the generated filei haven&#039;t tried using those proxies at runtime though, since i put my known types in a shared assembly and use it on both sides. The service&#039;s metadata properly returns the known types though, so i guess it should workBtw, you need to register the known types with the KnownTypeProvider client-side as well, at least if you&#039;re using the shared assembly approach.  Not sure if you still have to do this when you&#039;re using generated proxies, but it&#039;s probably worth trying if you haven&#039;t done so already</description> <content:encoded><![CDATA[<p>I actually have the KnownTypeProvider in a library (Brion.Library) which is referenced by my application.</p><p>In my application code, before i start hosting the service i do the following:</p><p><code></p><div
style="font-family: Consolas; font-size: 10pt; color: black; background: white;"><p
style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
style="color: #2b91af;">KnownTypeProvider</span>.RegisterDerivedTypesOf&lt;<span
style="color: #2b91af;">Request</span>&gt;(sharedAssembly);</p><p
style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span
style="color: #2b91af;">KnownTypeProvider</span>.RegisterDerivedTypesOf&lt;<span
style="color: #2b91af;">Response</span>&gt;(sharedAssembly);</p></div><p></code><code></p><p>If i start hosting the service and i try to generate a proxy with SvcUtil, all of the known types in my application's library are present in the generated file</p><p>i haven't tried using those proxies at runtime though, since i put my known types in a shared assembly and use it on both sides. The service's metadata properly returns the known types though, so i guess it should work</p><p>Btw, you need to register the known types with the KnownTypeProvider client-side as well, at least if you're using the shared assembly approach.  Not sure if you still have to do this when you're using generated proxies, but it's probably worth trying if you haven't done so already</code></p> ]]></content:encoded> </item> <item><title>By: Daniel</title><link>http://davybrion.com/blog/2008/07/the-known-type-provider/comment-page-1/#comment-1184</link> <dc:creator>Daniel</dc:creator> <pubDate>Sun, 17 Aug 2008 04:53:33 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=193#comment-1184</guid> <description>This seems like it would provide a lot of flexibility since we wouldn&#039;t have to declare known types explicitly, but will this method work over layers? If I use the hard-coded attribute style for my service contract, I can access those known types as proxies on the client. Since the GetKnownTypes method is static, if I put this functionality up in the core library, I can&#039;t override it in the service layer and provide my known types there. I haven&#039;t had much success getting the proxies when updating my service reference in client code. Is it possible to use this in a Core library scenario or should I just suck it up and implement it in the services layer specifically? It&#039;d be nice to package it up where my implementing layers would automatically add the known types for all messages, message handlers, DTOs, et al. for free just by using the base service contract in the core, and these would be available as proxies through the service reference.</description> <content:encoded><![CDATA[<p>This seems like it would provide a lot of flexibility since we wouldn&#8217;t have to declare known types explicitly, but will this method work over layers? If I use the hard-coded attribute style for my service contract, I can access those known types as proxies on the client. Since the GetKnownTypes method is static, if I put this functionality up in the core library, I can&#8217;t override it in the service layer and provide my known types there. I haven&#8217;t had much success getting the proxies when updating my service reference in client code. Is it possible to use this in a Core library scenario or should I just suck it up and implement it in the services layer specifically? It&#8217;d be nice to package it up where my implementing layers would automatically add the known types for all messages, message handlers, DTOs, et al. for free just by using the base service contract in the core, and these would be available as proxies through the service reference.</p> ]]></content:encoded> </item> <item><title>By: Daniel</title><link>http://davybrion.com/blog/2008/07/the-known-type-provider/comment-page-1/#comment-963</link> <dc:creator>Daniel</dc:creator> <pubDate>Fri, 01 Aug 2008 00:58:32 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=193#comment-963</guid> <description>I was running into the same annoying problem when I was trying to serialize POCOs in my &lt;a href=&quot;http://csharpie.blogspot.com/2008/07/publisher-subscriber-pattern-using.html&quot; title=&quot;Publisher-Subscriber Pattern using Duplex Channel &quot; rel=&quot;nofollow&quot;&gt;pub-sub&lt;/a&gt; implementation.</description> <content:encoded><![CDATA[<p>I was running into the same annoying problem when I was trying to serialize POCOs in my <a
href="http://csharpie.blogspot.com/2008/07/publisher-subscriber-pattern-using.html" title="Publisher-Subscriber Pattern using Duplex Channel " rel="nofollow">pub-sub</a> implementation.</p> ]]></content:encoded> </item> <item><title>By: The Inquisitive Coder - Davy Brion&#8217;s Blog &#187; Blog Archive &#187; The Request/Response Service Layer</title><link>http://davybrion.com/blog/2008/07/the-known-type-provider/comment-page-1/#comment-899</link> <dc:creator>The Inquisitive Coder - Davy Brion&#8217;s Blog &#187; Blog Archive &#187; The Request/Response Service Layer</dc:creator> <pubDate>Sun, 27 Jul 2008 11:07:40 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=193#comment-899</guid> <description>[...] The Known Type Provider [...]</description> <content:encoded><![CDATA[<p>[...] The Known Type Provider [...]</p> ]]></content:encoded> </item> <item><title>By: Dew Drop - July 22, 2008 &#124; Alvin Ashcraft's Morning Dew</title><link>http://davybrion.com/blog/2008/07/the-known-type-provider/comment-page-1/#comment-833</link> <dc:creator>Dew Drop - July 22, 2008 &#124; Alvin Ashcraft's Morning Dew</dc:creator> <pubDate>Tue, 22 Jul 2008 11:59:57 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=193#comment-833</guid> <description>[...] The Known Type Provider (Davy Brion) [...]</description> <content:encoded><![CDATA[<p>[...] The Known Type Provider (Davy Brion) [...]</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/11 queries in 0.007 seconds using disk: basic
Object Caching 419/420 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: d18sni7re4ly7f.cloudfront.net

Served from: davybrion.com @ 2012-05-21 12:25:20 -->
