<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Writing a shim to solve problems with managed Office COM Add-ins</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx</link><description>If you&amp;#8217;ve been following my and Omar&amp;#8217;s blogs lately, you&amp;#8217;ll know that we&amp;#8217;ve been learning a lot about writing managed Outlook COM Add-ins and running into lots of complications in the process. Here I describe how a shim can help</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Writing a shim to solve problems with managed Office COM Add-ins</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx#128387</link><pubDate>Sat, 08 May 2004 10:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:128387</guid><dc:creator>Snorrk</dc:creator><description>Woha! Seems to good to be true :) Thanks!&lt;br&gt;&lt;br&gt;&amp;gt;S</description></item><item><title>Programming for Outlook using managed code is better with a Shim</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx#130952</link><pubDate>Thu, 13 May 2004 08:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:130952</guid><dc:creator>Omar Shahine's WebLog</dc:creator><description /></item><item><title>re: Writing a shim to solve problems with managed Office COM Add-ins</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx#145539</link><pubDate>Tue, 01 Jun 2004 16:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:145539</guid><dc:creator>Bill</dc:creator><description>I've followed the MSDN step-by-step article to the point where it states to sign the unmanaged shim.  I don't know how to do that?  &lt;br&gt;&lt;br&gt;Also, the example uses the &amp;quot;HelloCOMAddInVB.snk&amp;quot; key in the Assembly attribute.  Does that mean the managed addin is already properly being &amp;quot;strong named&amp;quot;?  Is there something else I must do with it?&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Writing a shim to solve problems with managed Office COM Add-ins</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx#151065</link><pubDate>Tue, 08 Jun 2004 17:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:151065</guid><dc:creator>Dan Crevier</dc:creator><description>You need to follow these instructions to sign your shim. I have not actually gone through that process, so I can't comment on specifics:&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmarttag/html/odc_dcss.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmarttag/html/odc_dcss.asp&lt;/a&gt;&lt;br&gt;&lt;br&gt;By strongly named assembly, I meant that the szAddInAssemblyName variable needs to have the public key in there. You should use your own key pair, not the .snk file that was provided in the sample.</description></item><item><title>re: Writing a shim to solve problems with managed Office COM Add-ins</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx#159829</link><pubDate>Sat, 19 Jun 2004 02:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:159829</guid><dc:creator>brian</dc:creator><description>Thanks for posting the tip about not adding the public token string in the shim. I was pulling my hair out all day trying to figure out why things weren't working.&lt;br&gt;&lt;br&gt;For some reason whenever you recompile a dll you get a new public key token which causes A LOT of extra work in the build process. I would expect that since everyone goes through the trouble of using a snk key that this public key token wouldn't change. Also, if you don't check the 'Register for COM Interop' option in the vb project the connect method isn't called for debugging.&lt;br&gt;&lt;br&gt;We're writing an add-in for visio and to authenticode sign everything and make it work we have to do these steps:&lt;br&gt;1. Compile the managed add-in on it's own&lt;br&gt;2. get the public key token with sn -t&lt;br&gt;3. Put the public key token in the unmanaged shim public token string&lt;br&gt;4. compile the unmanaged shim.&lt;br&gt;5. Authenticode sign the unmanaged shim&lt;br&gt;6. Add the managed addin and unmanaged shim to the installer binaries (we don't use the built in installer with .net as it's got TONS of problems).&lt;br&gt;7. Build and test installer&lt;br&gt;&lt;br&gt;Note that after step 3 if you build or rebuild your addin the key will change and the unmanaged addin will no longer call it; you have to start over.&lt;br&gt;&lt;br&gt;So far I'm only doing this with our dll's and I've just gotten it to work. Thanks for your tip.</description></item><item><title>need help</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx#189946</link><pubDate>Wed, 21 Jul 2004 16:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:189946</guid><dc:creator>Sven</dc:creator><description>can you provide an example project with c#?&lt;br&gt;&lt;br&gt;my problem is, that my shim will not load in word&lt;br&gt;&lt;br&gt;the addin is written in c#, i followed the steps from the article&lt;br&gt;&lt;br&gt;everything is compiled fine, the shim is registered correctly but is not shown under word-comaddins</description></item><item><title>re: Writing a shim to solve problems with managed Office COM Add-ins</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx#190872</link><pubDate>Thu, 22 Jul 2004 04:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:190872</guid><dc:creator>Dan Crevier</dc:creator><description>I'm not that familiar with Word add-ins. Was it loading before you added the shim?</description></item><item><title>Invalid Type Cast Problem. | keyongtech</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx#9365710</link><pubDate>Thu, 22 Jan 2009 12:49:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9365710</guid><dc:creator>Invalid Type Cast Problem. | keyongtech</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.keyongtech.com/2380159-invalid-type-cast-problem"&gt;http://www.keyongtech.com/2380159-invalid-type-cast-problem&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Dan Crevier s Blog Writing a shim to solve problems with managed | Hair Growth Products</title><link>http://blogs.msdn.com/dancre/archive/2004/05/08/128350.aspx#9744421</link><pubDate>Sat, 13 Jun 2009 15:17:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9744421</guid><dc:creator> Dan Crevier s Blog Writing a shim to solve problems with managed | Hair Growth Products</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://hairgrowthproducts.info/story.php?id=5469"&gt;http://hairgrowthproducts.info/story.php?id=5469&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>