<?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>Chris Riesgo</title>
	<atom:link href="http://chrisriesgo.com/feed" rel="self" type="application/rss+xml" />
	<link>http://chrisriesgo.com</link>
	<description></description>
	<lastBuildDate>Fri, 17 Feb 2012 13:24:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Visual Studio: Error When Specifying Platform Target</title>
		<link>http://chrisriesgo.com/pro/visual-studio-error-when-specifying-platform-target</link>
		<comments>http://chrisriesgo.com/pro/visual-studio-error-when-specifying-platform-target#comments</comments>
		<pubDate>Thu, 16 Feb 2012 20:11:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Developer Stuff]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://chrisriesgo.com/?p=45</guid>
		<description><![CDATA[Recently I ran into an issue where a WCF Service Host assembly had specified the Build Platform Target as x64 (64-bit). When trying to hit the service I would see an error: Could not load file or assembly &#8216;[NAME]&#8216; or one of its dependencies. An attempt was made to load a program with an incorrect [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I ran into an issue where a WCF Service Host assembly had specified the Build Platform Target as x64 (64-bit). When trying to hit the service I would see an error:</p>
<blockquote><p>Could not load file or assembly &#8216;[NAME]&#8216; or one of its dependencies. An attempt was made to load a program with an incorrect format.</p>
<p>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</p></blockquote>
<p>It seems that by specifying the Target Platform of 64-bit in this case, a 32-bit application was causing a collision. Below are the steps that I was able to follow in order to clear up the issue:<code></code></p>
<p><strong>Steps</strong></p>
<ol>
<li>Open the project file for editing in Visual Studio.</li>
<ol>
<li>Right-click on the project file in Solution Explorer</li>
<li>Select &#8216;Edit Project File&#8217;</li>
</ol>
<li>Remove the PlatformTarget element from all configuration property groups.</li>
</ol>
<div><span style="text-decoration: underline;">An Example PropertyGroup Configuration:</span></div>
<p style="padding-left: 30px;">&lt;PropertyGroup Condition=&#8221; &#8216;$(Configuration)|$(Platform)&#8217; == &#8216;Debug|AnyCPU&#8217; &#8220;&gt;<br />
&lt;DebugSymbols&gt;&lt;/DebugSymbols&gt;<br />
&lt;DebugType&gt;&lt;/DebugType&gt;<br />
&lt;Optimize&gt;&lt;/Optimize&gt;<br />
&lt;OutputPath&gt;&lt;/OutputPath&gt;<br />
&lt;DefineConstants&gt;&lt;/DefineConstants&gt;<br />
&lt;ErrorReport&gt;&lt;/ErrorReport&gt;<br />
&lt;WarningLevel&gt;&lt;/WarningLevel&gt;<br />
<del>&lt;PlatformTarget&gt;x64&lt;/PlatformTarget&gt;</del><br />
&lt;/PropertyGroup&gt;</p>
<p><span style="font-family: Verdana;"><span style="text-decoration: underline;"><br />
</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://chrisriesgo.com/pro/visual-studio-error-when-specifying-platform-target/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arrow Versus The Beetle</title>
		<link>http://chrisriesgo.com/on-arrow-and-bacon/arrow-versus-the-beetle</link>
		<comments>http://chrisriesgo.com/on-arrow-and-bacon/arrow-versus-the-beetle#comments</comments>
		<pubDate>Mon, 11 Apr 2011 14:06:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[On Arrow and Bacon]]></category>
		<category><![CDATA[arrow]]></category>

		<guid isPermaLink="false">http://chrisriesgo.com/?p=41</guid>
		<description><![CDATA[The weather this past weekend was incredible! [Which reminds me, I need a comfy bistro set for my patio if anyone has any suggestions.] I&#8217;m usually taking a chance by throwing open my patio door because it isn&#8217;t screened, and well&#8230;all manner of creatures apparently like cool, air-conditioned spaces; Sunday was no exception. There was [...]]]></description>
			<content:encoded><![CDATA[<p>The weather this past weekend was incredible! [Which reminds me, I need a comfy bistro set for my patio if anyone has any suggestions.] I&#8217;m usually taking a chance by throwing open my patio door because it isn&#8217;t screened, and well&#8230;all manner of creatures apparently like cool, air-conditioned spaces; Sunday was no exception. There was a lizard at one point and a few beetles later in the evening. While Arrow didn&#8217;t pay any attention to the speedy lizard, he was very interested in this beetle.</p>
<p style="text-align: center;"><iframe src="http://www.youtube.com/embed/OPBOJykcTLs" frameborder="0" width="90%" height="450px"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://chrisriesgo.com/on-arrow-and-bacon/arrow-versus-the-beetle/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WCF &#8211; The remote server returned an unexpected response: (400) Bad Request</title>
		<link>http://chrisriesgo.com/pro/wcf-the-remote-server-returned-an-unexpected-response-400-bad-request</link>
		<comments>http://chrisriesgo.com/pro/wcf-the-remote-server-returned-an-unexpected-response-400-bad-request#comments</comments>
		<pubDate>Wed, 06 Apr 2011 16:21:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Developer Stuff]]></category>

		<guid isPermaLink="false">http://chrisriesgo.com/?p=25</guid>
		<description><![CDATA[When trying to call out to a WCF service, I was receiving the error: The remote server returned an unexpected response: (400) Bad Request. If you&#8217;re seeing the same thing, I might be able to help. Are you attempting to send any sizable amount of data across the wire to the service? If yes, then the [...]]]></description>
			<content:encoded><![CDATA[<div><span>When trying to call out to a WCF service, I was receiving the error: </span>The remote server returned an unexpected response: (400) Bad Request. If you&#8217;re seeing the same thing, I might be able to help.</div>
<div><span><br />
</span></div>
<div><span>Are you attempting to send any sizable amount of data across the wire to the service? If yes, then the likely problem is that the remote service&#8217;s config needs to be updated to accept larger requests. Update your service&#8217;s binding in the &lt;bindings&gt; segment of your remote service&#8217;s config file:</span></div>
<div>
<div>
<pre></pre>
<pre></pre>
<pre><code>[...]
&lt;system.serviceModel&gt;
     &lt;bindings&gt;
       &lt;wsHttpBinding&gt;
         &lt;binding name="wsHttp" maxReceivedMessageSize="<wbr>50000000"
 maxBufferPoolSize="50000000" messageEncoding="Mtom" &gt;
           &lt;readerQuotas maxDepth="500000000" maxStringContentLength="<wbr>500000000" maxArrayLength="500000000" maxBytesPerRead="500000000"
 maxNameTableCharCount="<wbr>500000000" /&gt;
           &lt;security mode="None"&gt;&lt;/security&gt;
         &lt;/binding&gt;
       &lt;/wsHttpBinding&gt;
     &lt;/bindings&gt;
</wbr></wbr></wbr>[...]</code></pre>
<pre><span style="font-family: monospace;">
</span></pre>
<div><span>By default, the max size for most of the binding properties are around 64KB. If you think  your request is larger, try debugging to find out. </span></div>
</div>
<div><span><br />
</span></div>
<div><span><strong>Note:</strong></span></div>
<div><span>Make sure you actually change the config in the remote location (not just the one in your calling assembly).</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://chrisriesgo.com/pro/wcf-the-remote-server-returned-an-unexpected-response-400-bad-request/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An invalid character was found in the mail header: &#8216;;&#8217;</title>
		<link>http://chrisriesgo.com/pro/an-invalid-character-was-found-in-the-mail-header-semi</link>
		<comments>http://chrisriesgo.com/pro/an-invalid-character-was-found-in-the-mail-header-semi#comments</comments>
		<pubDate>Wed, 06 Apr 2011 16:10:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Developer Stuff]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[mailaddress]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://chrisriesgo.com/?p=20</guid>
		<description><![CDATA[While trying to queue up a message to send out to an email service, I ran into the error: An invalid character was found in the mail header: &#8216;;&#8217;. A quick search engine lookup will return results that may or may not pertain to your specific problem. I&#8217;ll tell you what ended up being wrong [...]]]></description>
			<content:encoded><![CDATA[<p>While trying to queue up a message to send out to an email service, I ran into the error: An invalid character was found in the mail header: &#8216;;&#8217;. A quick search engine lookup will return results that may or may not pertain to your specific problem. I&#8217;ll tell you what ended up being wrong with mine.</p>
<p>The email service that I&#8217;m calling into accepts the ToAddress as a string[] array of email addresses (which it then probably converts to System.Net.Mail.MailAddresses)<wbr>. My ToAddress was being read from a config file where the entry read something like:  &#8220;<a href="mailto:email@domain.com" target="_blank">email@domain.com</a>;<a href="mailto:email2@domain.com" target="_blank">email2@<wbr>domain.com</wbr></a>&#8220;. I was seeing the error because the config entry was not being split out into a string[] array properly, and SmtpClient apparently doesn&#8217;t like stray characters (&#8220;;&#8221;) in its email addresses. Quick solution:</wbr></p>
<p><span style="color: #006600;">// Read recipient from config file</span><br />
var recipient = ConfigurationManager.<wbr>AppSettings["CONFIG_KEY"];</wbr></p>
<p><span style="color: #006600;">// Make sure addresses are all separated by the same delimiting character</span><br />
recipient = recipient.Replace(&#8220;,&#8221;, &#8220;;&#8221;);</p>
<p><span style="color: #006600;">// Split the recipient string by the delimiting character and build a string[] array of recipients</span><br />
var toAddresses = recipient.Split(new char[] { &#8216;;&#8217; }, StringSplitOptions.<wbr>RemoveEmptyEntries);</wbr></p>
<p><strong>Note:</strong><br />
System.Net.Mail.MailMessage&#8217;s &#8220;To&#8221; property is a collection of MailAddresses. If you need to populate MailAddress objects yourself you can do a few things differently:</p>
<p><span style="font-family: arial, helvetica, sans-serif;"><span style="color: #006600;">// Continue from the above string[] array method</span><br />
var mailAddresses = new MailAddressCollection();</span></p>
<p><span style="color: #006600;">// Use each address to create a new MailAddress and add to the MailAddressCollection</span><br />
toAddresses.ToList().ForEach(<wbr>address =&gt;<br />
{<br />
mailAddresses.Add(new MailAddress(address));<br />
}</wbr></p>
<p>OR</p>
<p><span style="color: #006600;">// Make sure addresses are all separated by a comma</span><br />
recipient = recipient.Replace(&#8220;;&#8221;, &#8220;,&#8221;);</p>
<p><span style="color: #006600;">// MailAddressCollection has a constructor that accepts a comma-delimited list of email addresses</span><br />
var mailAddresses = new MailAddressCollection() { recipient };</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisriesgo.com/pro/an-invalid-character-was-found-in-the-mail-header-semi/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

