<?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: Module initializers in C#</title>
	<atom:link href="http://einaregilsson.com/module-initializers-in-csharp/feed/" rel="self" type="application/rss+xml" />
	<link>http://einaregilsson.com/module-initializers-in-csharp/</link>
	<description>A site for my programming pet projects</description>
	<lastBuildDate>Mon, 23 Jan 2012 07:51:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: einar</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75963</link>
		<dc:creator>einar</dc:creator>
		<pubDate>Tue, 10 Jan 2012 09:01:52 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75963</guid>
		<description>@Aura: Actually, as I was looking through the source now to update it, I saw that the WriterParameters and ReaderParameters that are sent into WriteAssembly and ReadAssembly have a .SymbolStream property. You might be able to give them a stream to your .pdf files directly there, if you&#039;re willing to hack on it a bit.</description>
		<content:encoded><![CDATA[<p>@Aura: Actually, as I was looking through the source now to update it, I saw that the WriterParameters and ReaderParameters that are sent into WriteAssembly and ReadAssembly have a .SymbolStream property. You might be able to give them a stream to your .pdf files directly there, if you&#8217;re willing to hack on it a bit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: einar</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75962</link>
		<dc:creator>einar</dc:creator>
		<pubDate>Tue, 10 Jan 2012 08:51:30 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75962</guid>
		<description>@newl: Great. I actually just went and fixed those issues in the source. The latest source is up at github, at http://github.com/einaregilsson/InjectModuleInitializer. I&#039;ll make an update to the blog post soon and release a new merged assembly as well.</description>
		<content:encoded><![CDATA[<p>@newl: Great. I actually just went and fixed those issues in the source. The latest source is up at github, at <a href="http://github.com/einaregilsson/InjectModuleInitializer" rel="nofollow">http://github.com/einaregilsson/InjectModuleInitializer</a>. I&#8217;ll make an update to the blog post soon and release a new merged assembly as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: newl</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75959</link>
		<dc:creator>newl</dc:creator>
		<pubDate>Tue, 10 Jan 2012 00:37:59 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75959</guid>
		<description>Thanks for the response einar.

Changing that in the InjectInitializer method and also removing the TypeReference in the FullName call of GetCalleeMethod and replacing the value passed into the Equals method to &quot;System.Void&quot; seems to have resolved the culture issue when targeting framework 4.

Now to try and figure out why the dependent assembly that I have embedded in a dll isn&#039;t being loaded using this new method. :)</description>
		<content:encoded><![CDATA[<p>Thanks for the response einar.</p>
<p>Changing that in the InjectInitializer method and also removing the TypeReference in the FullName call of GetCalleeMethod and replacing the value passed into the Equals method to &#8220;System.Void&#8221; seems to have resolved the culture issue when targeting framework 4.</p>
<p>Now to try and figure out why the dependent assembly that I have embedded in a dll isn&#8217;t being loaded using this new method. <img src='http://einaregilsson.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: einar</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75958</link>
		<dc:creator>einar</dc:creator>
		<pubDate>Mon, 09 Jan 2012 15:01:18 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75958</guid>
		<description>@newl: I haven&#039;t tested this but you could try changing this line in InjectInitializer:

TypeReference voidRef = Assembly.MainModule.Import(typeof(void));

to

TypeReference voidRef = callee.ReturnType;

That *should* work, since you&#039;re getting a void reference from the targeted assembly, but I haven&#039;t tried to compile this or anything. Let me know how it works out :)</description>
		<content:encoded><![CDATA[<p>@newl: I haven&#8217;t tested this but you could try changing this line in InjectInitializer:</p>
<p>TypeReference voidRef = Assembly.MainModule.Import(typeof(void));</p>
<p>to</p>
<p>TypeReference voidRef = callee.ReturnType;</p>
<p>That *should* work, since you&#8217;re getting a void reference from the targeted assembly, but I haven&#8217;t tried to compile this or anything. Let me know how it works out <img src='http://einaregilsson.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: newl</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75957</link>
		<dc:creator>newl</dc:creator>
		<pubDate>Mon, 09 Jan 2012 06:02:28 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75957</guid>
		<description>I&#039;m receiving the same culture related exception that was mentioned above.  I too am targeting .NET Framework v4 assembly.

Juan mentioned that he was able to fix it and doesn&#039;t appear to have provided a patch.  Simply retargeting the solution for framework 4 doesn&#039;t resolve the issue.  What is the fix?</description>
		<content:encoded><![CDATA[<p>I&#8217;m receiving the same culture related exception that was mentioned above.  I too am targeting .NET Framework v4 assembly.</p>
<p>Juan mentioned that he was able to fix it and doesn&#8217;t appear to have provided a patch.  Simply retargeting the solution for framework 4 doesn&#8217;t resolve the issue.  What is the fix?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: einar</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75950</link>
		<dc:creator>einar</dc:creator>
		<pubDate>Sat, 07 Jan 2012 18:35:31 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75950</guid>
		<description>@Aura: Sorry, no, I have no idea how exactly it gets the pdb name. I browsed quickly throught the Cecil source at https://github.com/jbevain/cecil/tree/master/Mono.Cecil but it&#039;s hard to figure out :)</description>
		<content:encoded><![CDATA[<p>@Aura: Sorry, no, I have no idea how exactly it gets the pdb name. I browsed quickly throught the Cecil source at <a href="https://github.com/jbevain/cecil/tree/master/Mono.Cecil" rel="nofollow">https://github.com/jbevain/cecil/tree/master/Mono.Cecil</a> but it&#8217;s hard to figure out <img src='http://einaregilsson.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aura</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75948</link>
		<dc:creator>Aura</dc:creator>
		<pubDate>Thu, 05 Jan 2012 20:59:48 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75948</guid>
		<description>This is exactly what I&#039;m looking for and I&#039;d be happy even if you can&#039;t answer what I&#039;m asking, but...

It seems like it tries to look for the pdb file in the same directory as the assembly that I&#039;m trying to inject. Is there a way for me to specify where the pdb file is, using Mono.Cecil.Pdb, when calling ReadAssembly() and WriteAssembly() in the class InjectModuleInitializerImpl? Documentation seems to be not abundant for Mono.Cecil to say the least.</description>
		<content:encoded><![CDATA[<p>This is exactly what I&#8217;m looking for and I&#8217;d be happy even if you can&#8217;t answer what I&#8217;m asking, but&#8230;</p>
<p>It seems like it tries to look for the pdb file in the same directory as the assembly that I&#8217;m trying to inject. Is there a way for me to specify where the pdb file is, using Mono.Cecil.Pdb, when calling ReadAssembly() and WriteAssembly() in the class InjectModuleInitializerImpl? Documentation seems to be not abundant for Mono.Cecil to say the least.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Cropp</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75149</link>
		<dc:creator>Simon Cropp</dc:creator>
		<pubDate>Wed, 10 Aug 2011 23:01:53 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75149</guid>
		<description>Einar

Just a short thanks because this post helped me build this

http://code.google.com/p/costura/wiki/HowItWorksEmbedTask

Keep up the good work.</description>
		<content:encoded><![CDATA[<p>Einar</p>
<p>Just a short thanks because this post helped me build this</p>
<p><a href="http://code.google.com/p/costura/wiki/HowItWorksEmbedTask" rel="nofollow">http://code.google.com/p/costura/wiki/HowItWorksEmbedTask</a></p>
<p>Keep up the good work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: einar</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75007</link>
		<dc:creator>einar</dc:creator>
		<pubDate>Wed, 13 Jul 2011 08:36:05 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75007</guid>
		<description>@Juan: Cool. Are you on Github by any chance? I haven&#039;t updated the blog post, but the code lives on github at https://github.com/einaregilsson/InjectModuleInitializer . If you&#039;re there, please fork, patch, and send me a pull request! :)</description>
		<content:encoded><![CDATA[<p>@Juan: Cool. Are you on Github by any chance? I haven&#8217;t updated the blog post, but the code lives on github at <a href="https://github.com/einaregilsson/InjectModuleInitializer" rel="nofollow">https://github.com/einaregilsson/InjectModuleInitializer</a> . If you&#8217;re there, please fork, patch, and send me a pull request! <img src='http://einaregilsson.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juan Campa</title>
		<link>http://einaregilsson.com/module-initializers-in-csharp/comment-page-1/#comment-75005</link>
		<dc:creator>Juan Campa</dc:creator>
		<pubDate>Wed, 13 Jul 2011 06:18:33 +0000</pubDate>
		<guid isPermaLink="false">http://tech.einaregilsson.com/?p=352#comment-75005</guid>
		<description>Ok, I can now confirm that the double referencing *was* the problem. It didn&#039;t worked the first time because the void type was being imported while crafting the injected method also. I changed this so that the void TypeReference is taken out of the target assembly instead of the currently excecuting CLR. It&#039;s now working fine.

Thanks once again,
Juan</description>
		<content:encoded><![CDATA[<p>Ok, I can now confirm that the double referencing *was* the problem. It didn&#8217;t worked the first time because the void type was being imported while crafting the injected method also. I changed this so that the void TypeReference is taken out of the target assembly instead of the currently excecuting CLR. It&#8217;s now working fine.</p>
<p>Thanks once again,<br />
Juan</p>
]]></content:encoded>
	</item>
</channel>
</rss>

