<?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>seekingl33t</title>
	<atom:link href="http://cbtr.net/red8rain/feed/" rel="self" type="application/rss+xml" />
	<link>http://cbtr.net/red8rain</link>
	<description>all things learnt</description>
	<lastBuildDate>Thu, 19 Apr 2012 18:06:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>C#: Could not load file or assembly</title>
		<link>http://cbtr.net/red8rain/2012/04/19/csharp-could-not-load-file-or-assembly/</link>
		<comments>http://cbtr.net/red8rain/2012/04/19/csharp-could-not-load-file-or-assembly/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 15:56:57 +0000</pubDate>
		<dc:creator>Mr.ML</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Could not load file or assembly]]></category>
		<category><![CDATA[Could not load file or assembly 'Microsoft.Office.Interop.Excel]]></category>
		<category><![CDATA[Culture=neutral]]></category>
		<category><![CDATA[Microsoft.Office.Interop.Excel]]></category>
		<category><![CDATA[PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.]]></category>
		<category><![CDATA[Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Excel]]></category>
		<category><![CDATA[Version=14.0.0.0]]></category>

		<guid isPermaLink="false">http://cbtr.net/red8rain/?p=1091</guid>
		<description><![CDATA[As you may know, I&#8217;ve recently tweaked someone&#8217;s C# code to make it work the way I want.  That post can be found here.  I am pleased to say that it work perfectly on my laptop but when I loaded it on &#8230; <a href="http://cbtr.net/red8rain/2012/04/19/csharp-could-not-load-file-or-assembly/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As you may know, I&#8217;ve recently tweaked someone&#8217;s C# code to make it work the way I want.  That post can be found <a title="SSIS: Export more than 255 columns from SQL table to Excel" href="http://cbtr.net/red8rain/2012/04/17/ssis-export-more-than-255-columns-from-sql-table-to-excel/" target="_blank">here</a>.  I am pleased to say that it work perfectly on my laptop but when I loaded it on the server to be executed, I got the error:</p>
<blockquote><p>Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly &#8216;Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&#8217; or one of its dependencies. The system cannot find the file specified.</p></blockquote>
<p><span id="more-1091"></span></p>
<p>Once again, I took to the web, looking for the answer.  I found links and articles, read them, tried them and still didn&#8217;t work.  Last night, I was talking to a ex co-worker at Microsoft who is a seasoned C# developer and I brought up the question.  He, of course, was in bed and I was pretty much talking to myself via MSN Live Messenger.</p>
<p>But this morning he responded to my question:</p>
<blockquote><p>RD says (8:10 AM): look at your references in your project, and make sure all of them are set to copy local. Then when you deploy, deploy all the dlls with your exe.</p></blockquote>
<p>you can find this by expanding &#8216;References&#8217; &#8211;&gt; click on the reference and go to its property.  There look for, Copy Local.  By default, this is set to False.  Change it to True.  Setting the references to True will tell Visual Studio to extract the DLL from where-ever the hell it is stored (actually, you can tell where it is stored) to the bin\debug or bin\release folder when the project is compiled.  All you have to do afterward is copy the freshly minted .exec, .dlls, and .config (if one is used) to any Windows machine and it will work.</p>
<p>Thanks RD.</p>
]]></content:encoded>
			<wfw:commentRss>http://cbtr.net/red8rain/2012/04/19/csharp-could-not-load-file-or-assembly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

