<?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>..::\\ www.christiano.ch //::.. &#187; Winform</title>
	<atom:link href="http://www.christiano.ch/wordpress/tag/winform/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christiano.ch/wordpress</link>
	<description>christiano.ch blog - personal knowledge base, news, memoires et cetera</description>
	<lastBuildDate>Fri, 06 Jan 2012 15:28:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
		<item>
		<title>WCF Service: Adding a reference results in: System.BadImageFormatException</title>
		<link>http://www.christiano.ch/wordpress/2010/02/20/wcf-service-adding-a-reference-results-in-system-badimageformatexception/</link>
		<comments>http://www.christiano.ch/wordpress/2010/02/20/wcf-service-adding-a-reference-results-in-system-badimageformatexception/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 12:57:24 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[Service Reference]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Winform]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2010/02/20/wcf-service-adding-a-reference-results-in-system-badimageformatexception/</guid>
		<description><![CDATA[I have a Solution with a WCF Service Project, a few Classes in projects and a Winform Project. When trying to add a Service Reference from within the Winform Project i always got the Microsoft WCF Service Host &#8211; ‘System.BadImageFormatException: &#8230; <a href="http://www.christiano.ch/wordpress/2010/02/20/wcf-service-adding-a-reference-results-in-system-badimageformatexception/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="0" cellpadding="2" width="675">
<tbody>
<tr>
<td valign="top" width="672">I have a Solution with a WCF Service Project, a few Classes in projects and a Winform Project. When trying to add a Service Reference from within the Winform Project i always got the <em>Microsoft WCF Service Host &#8211; ‘System.BadImageFormatException: Could not load file or assembly &#8216;file’..</em></td>
<td valign="top" width="10"><a href="http://www.christiano.ch/wordpress/wp-content/uploads/2010/02/Logo_Visual_Studio_20101.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Logo Microsoft Visual Studio" border="0" alt="Logo Microsoft Visual Studio" src="http://www.christiano.ch/wordpress/wp-content/uploads/2010/02/Logo_Visual_Studio_2010_thumb1.jpg" width="165" height="64" /></a> </td>
</tr>
</tbody>
</table>
<p> <span id="more-873"></span>
<p>An explanation or better, a direction I’ve found at <a href="http://www.atalasoft.com/kb/article.aspx?id=10165" target="_blank">Atalasoft Knowledgebase Q10165</a>.</p>
<p>I just changed the <strong><em>Platform target </em></strong>from <strong><em>x86 </em></strong>to <strong><em>Any CPU</em></strong>, recompiled both projects in the solution and since then, i can add a service reference. Who knows why.. you? drop me a mail/comment!</p>
<p><strong><em>Error Message i got: </em></strong></p>
<p><em>System.BadImageFormatException: Could not load file or assembly &#8216;file:///D:\Development\WCFTestService.SQL.2010\Media.Manager.SQL.Services.WCF\bin\Debug\Media.Manager.SQL.Services.WCF.exe&#8217; or one of its dependencies. An attempt was made to load a program with an incorrect format.     <br />File name: &#8216;file:///D:\Development\WCFTestService.SQL.2010\Media.Manager.SQL.Services.WCF\bin\Debug\Media.Manager.SQL.Services.WCF.exe&#8217;      <br />&#160;&#160; at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)      <br />&#160;&#160; at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)      <br />&#160;&#160; at System.Reflection.Assembly.Load(AssemblyName assemblyRef)      <br />&#160;&#160; at Microsoft.Tools.SvcHost.ServiceHostHelper.LoadServiceAssembly(String svcAssemblyPath) </em></p>
<p><em>WRN: Assembly binding logging is turned OFF.     <br />To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.      <br />Note: There is some performance penalty associated with assembly bind failure logging.      <br />To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].</em></p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=WCF+Service%3A+Adding+a+reference+results+in%3A+System.BadImageFormatException+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D873" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=WCF+Service%3A+Adding+a+reference+results+in%3A+System.BadImageFormatException+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D873" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2010/02/20/wcf-service-adding-a-reference-results-in-system-badimageformatexception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

