<?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>Trying to walk that thin line between intelligence and ignorance</description>
	<lastBuildDate>Thu, 11 Mar 2010 06:13:45 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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 file

i 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 work

Btw, 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>
