<?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>Edwin M SarmientoCould not load file or assembly &#8211; Edwin M Sarmiento</title>
	<atom:link href="https://www.edwinmsarmiento.com/could-not-load-file-or-assembly/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.edwinmsarmiento.com</link>
	<description>Intentional Excellence</description>
	<lastBuildDate>Mon, 13 Apr 2026 21:00:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">84283043</site>		<item>
		<title>Could not load file or assembly</title>
		<link>https://www.edwinmsarmiento.com/could-not-load-file-or-assembly/</link>
		<comments>https://www.edwinmsarmiento.com/could-not-load-file-or-assembly/#respond</comments>
		<pubDate>Mon, 20 Apr 2009 18:51:00 +0000</pubDate>
		<dc:creator>Edwin M Sarmiento</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[Assembly Binding Logging Tool]]></category>
		<category><![CDATA[Fuslogvw.exe]]></category>
		<guid isPermaLink="false">http://bassplayerdoc.wordpress.com/2009/04/20/could-not-load-file-or-assembly</guid>

				<description><![CDATA[I was assisting one of our customers move their .NET applications from one server to another and run them using Windows Task Scheduler. I did highlight to them that in order to make the application work, we have to make sure that the correct .NET Framework version was installed on the target server, that the [&#8230;]]]></description>
					<content:encoded><![CDATA[<p><span style="font-family:arial;">I was assisting one of our customers move their .NET applications from one server to another and run them using Windows Task Scheduler. I did highlight to them that in order to make the application work, we have to make sure that the correct .NET Framework version was installed on the target server, that the correct .NET Framework version was referenced by the assemblies used (this is very important when the target server has multiple versions of the .NET Framework installed and the assembly was created using an older version) and that the appropriate permissions were given to the accounts that will launch the EXE files from within the Windows Scheduled Tasks. I wasn&#8217;t surprised when after the move, I saw this error from calling the assembly from the command prompt</span></p>
<p><span style="font-style:italic;color:#ff0000;font-family:lucida grande;">System.IO.FileNotFoundException: Could not load file or assembly &#8216;MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0e1d67af9d31f077&#8217; or one of its dependencies. The system cannot find the file specified.</span><br />
<span style="font-style:italic;color:#ff0000;font-family:lucida grande;">File name: &#8216;MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0e1d67af9d31f077&#8217; &#8212;&gt; System.IO.FileNotFoundException: Could not load file or assembly &#8216;MyAssembly&#8217; or one of its dependencies. The system cannot find the file specified.</span><br />
<span style="font-style:italic;color:#ff0000;font-family:lucida grande;">File name: &#8216;MyAssembly&#8217;</span></p>
<p><span style="color:#000000;font-family:arial;">This <a href="http://blogs.msdn.com/dougste/archive/2006/09/05/741329.aspx">blog post</a> highlights a couple of different reasons why an assembly would not load. What I would like to highlight, though, is the use of a pointer to the correct .NET Framework version in the application&#8217;s config files.</span><br />
<span style="color:#000000;font-family:arial;"><br />
A lot of developers in the past simply didn&#8217;t realize that it would be possible to co-exist different versions of the .NET Framework in a single machine yet cause application issues if not handled properly. This <a href="http://www.microsoft.com/windowsserver2003/techinfo/serverroles/appserver/mngfrmwk.mspx">Microsoft document</a>, although relatively old, describes how to manage multiple versions of the .NET Framework on a single machine. If unsure, you might want to enable the Assembly binding logging option thru your registry key<br />
<span style="font-size:85%;"><br />
</span></span><span style="font-size:85%;"><span style="font-weight:bold;font-style:italic;">[HKEY_LOCAL_MACHINESOFTWAREMicrosoftFusion!EnableLog] (DWORD) = 1</span></span></p>
<p><span style="font-family:arial;">You can also use the </span><a style="font-family:arial;" href="http://msdn.microsoft.com/en-us/library/e74a18c4%28VS.80%29.aspx">Assembly Binding Log Viewer</a><span style="font-family:arial;"> tool if you have the SDK Tools installed on your target machine (of course, as best practice will tell you, you wouldn&#8217;t install anything unnecessary on your production servers)<br />
</span></p>
<div class="blogger-post-footer"><img decoding="async" src="https://blogger.googleusercontent.com/tracker/92377218009570869-2035568428043809901?l=bassplayerdoc.blogspot.com" alt="" width="1" height="1" /></div>
]]></content:encoded>
			

		<wfw:commentRss>https://www.edwinmsarmiento.com/could-not-load-file-or-assembly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
				<post-id xmlns="com-wordpress:feed-additions:1">186</post-id>	</item>
	</channel>
</rss>