<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rohland de Charmoy &#187; MEF</title>
	<atom:link href="http://www.rohland.co.za/index.php/tag/mef/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rohland.co.za</link>
	<description>Pushing buttons...</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:01:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>MEF Preview 5</title>
		<link>http://www.rohland.co.za/index.php/2009/04/23/mef-preview-5/</link>
		<comments>http://www.rohland.co.za/index.php/2009/04/23/mef-preview-5/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 11:40:37 +0000</pubDate>
		<dc:creator>Rohland</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[MEF]]></category>

		<guid isPermaLink="false">http://www.rohland.co.za/?p=19</guid>
		<description><![CDATA[Just upgraded to MEF preview 5 and thought I would just post a gotcha that had me puzzled for a few minutes. After upgrading none of my exported parts were being picked up after composing an instance of the composition container class. I was exporting my types as per the example below: &#160;&#160;&#160; 1 [Export("DataTransformation.Task")] [...]]]></description>
			<content:encoded><![CDATA[<p><P>Just upgraded to <A href="http://mef.codeplex.com/" target=_blank mce_href="http://mef.codeplex.com">MEF</A> preview 5 and thought I would just post a gotcha that had me puzzled for a few minutes. After upgrading none of my exported parts were being picked up after composing an instance of the composition container class. I was exporting my types as per the example below:</P></p>
<p><DIV class="code" style="PADDING-BOTTOM: 5px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: consolas; BACKGROUND: black; COLOR: white; FONT-SIZE: 10pt; FONT-WEIGHT: bold; PADDING-TOP: 5px"><br />
<P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 1</SPAN> [<SPAN style="COLOR: #ffc66d">Export</SPAN>(<SPAN style="COLOR: #a5c25c">"DataTransformation.Task"</SPAN>)]</P></p>
<p><P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 2</SPAN>&nbsp;<SPAN style="COLOR: #cc7832">public</SPAN> <SPAN style="COLOR: #cc7832">class</SPAN> <SPAN style="COLOR: #ffc66d">Task</SPAN> : <SPAN style="COLOR: #ffc66d">DataTransformationTask</SPAN></P></p>
<p><P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 3</SPAN> {</P></p>
<p><P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 4</SPAN>&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: gray">// &#8230;.</SPAN></P></p>
<p><P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 5</SPAN> }</P><br />
</DIV><br />
<P>With MEF preview 5 you<STRONG> </STRONG>have to <STRONG>explicitly</STRONG> pass the type you are exporting in the Export attribute constructor as per below:</P></p>
<p><DIV class="code" style="PADDING-BOTTOM: 5px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: consolas; BACKGROUND: black; COLOR: white; FONT-SIZE: 10pt; FONT-WEIGHT: bold; PADDING-TOP: 5px"><br />
<P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 1</SPAN> [<SPAN style="COLOR: #ffc66d">Export</SPAN>(<SPAN style="COLOR: #a5c25c">"DataTransformation.Task"</SPAN>, <SPAN style="COLOR: #cc7832">typeof</SPAN>(<SPAN style="COLOR: #ffc66d">DataTransformationTask</SPAN>))]</P></p>
<p><P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 2</SPAN>&nbsp;<SPAN style="COLOR: #cc7832">public</SPAN> <SPAN style="COLOR: #cc7832">class</SPAN> <SPAN style="COLOR: #ffc66d">Task</SPAN> : <SPAN style="COLOR: #ffc66d">DataTransformationTask</SPAN></P></p>
<p><P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 3</SPAN> {</P></p>
<p><P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 4</SPAN>&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: gray">// &#8230;.</SPAN></P></p>
<p><P style="MARGIN: 0px"><SPAN style="COLOR: #2b91af; FONT-WEIGHT: normal">&nbsp;&nbsp;&nbsp; 5</SPAN> }</P><br />
</DIV><br />
<P>If you would like to find out what else has changed I would recommend taking a read through Glenn Block’s blog review here: <A href="http://codebetter.com/blogs/glenn.block/archive/2009/04/11/mef-preview-5-changes-and-enhancements.aspx" mce_href="http://codebetter.com/blogs/glenn.block/archive/2009/04/11/mef-preview-5-changes-and-enhancements.aspx">http://codebetter.com/blogs/glenn.block/archive/2009/04/11/mef-preview-5-changes-and-enhancements.aspx</A></P></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rohland.co.za/index.php/2009/04/23/mef-preview-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

