<?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>Stronico - Steroids for Networking &#187; How To Fix</title>
	<atom:link href="http://blog.stronico.com/category/howtofix/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stronico.com</link>
	<description>We help the world’s best salesmen build better networks</description>
	<lastBuildDate>Tue, 27 Jul 2010 22:59:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Silverlight Tip &#8211; How to make bold text in a textblock from the CodeBehind</title>
		<link>http://blog.stronico.com/2010/07/silverlight-tip-how-to-make-bold-text-in-a-textblock-from-the-codebehind/</link>
		<comments>http://blog.stronico.com/2010/07/silverlight-tip-how-to-make-bold-text-in-a-textblock-from-the-codebehind/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 22:59:26 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[How To Fix]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=526</guid>
		<description><![CDATA[<p><strong>The Problem: </strong>You need to conditionally bold text in a text block, but you cannot find any way of doing so</p>
<p><strong>The Cause:</strong> For inexplicable reasons, Microsoft chose not to include a FontWeight.Bold in their xaml specification</p>
<p><a href="http://blog.stronico.com/2010/07/silverlight-tip-how-to-make-bold-text-in-a-textblock-from-the-codebehind/" class="more-link">Read more on Silverlight Tip &#8211; How to make bold text in a textblock from the CodeBehind&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=526&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><strong>The Problem: </strong>You need to conditionally bold text in a text block, but you cannot find any way of doing so</p>
<p><strong>The Cause:</strong> For inexplicable reasons, Microsoft chose not to include a FontWeight.Bold in their xaml specification</p>
<p><strong>The Solution:</strong> Microsoft did include a FontWeights (note the S) class  To bold text in the codebehind, all you have to do is write this</p>
<blockquote><p>﻿﻿tbbDownloader.FontWeight = FontWeights.Bold;</p></blockquote>
<p>And presto!  Bold Text.</p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=526&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/07/silverlight-tip-how-to-make-bold-text-in-a-textblock-from-the-codebehind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix a missing reference to mscorlib in Visual Studio 2010</title>
		<link>http://blog.stronico.com/2010/07/how-to-fix-a-missing-reference-to-mscorlib-in-visual-studio-2010/</link>
		<comments>http://blog.stronico.com/2010/07/how-to-fix-a-missing-reference-to-mscorlib-in-visual-studio-2010/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 18:28:57 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[How To Fix]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=523</guid>
		<description><![CDATA[<p><a title="Runtime compiling is great" href="http://www.flickr.com/photos/15304862@N04/4650722495/" target="_blank"><img class="alignright" style="border: 0px initial initial;" src="http://farm5.static.flickr.com/4002/4650722495_e4fd4539c1_m.jpg" border="0" alt="Runtime compiling is great" width="240" height="146" /></a>I was trying to update my main app code to utilize the .Net Framework 4.0 and this happened:</p>
<p><strong>The Problem:</strong> I could find no obvious way to update the mscorlib reference in my solution, so I decide to simply delete it and add it again, and hope that it magically updates to the most recent version.  This is actually what usually happens with Visual Studio.  However, I delete the mscorlib reference, and I am unable to add it back again, I get the error message telling me that mscorlib is already included in the project.</p>
<p><a href="http://blog.stronico.com/2010/07/how-to-fix-a-missing-reference-to-mscorlib-in-visual-studio-2010/" class="more-link">Read more on How to fix a missing reference to mscorlib in Visual Studio 2010&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=523&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><a title="Runtime compiling is great" href="http://www.flickr.com/photos/15304862@N04/4650722495/" target="_blank"><img class="alignright" style="border: 0px initial initial;" src="http://farm5.static.flickr.com/4002/4650722495_e4fd4539c1_m.jpg" border="0" alt="Runtime compiling is great" width="240" height="146" /></a>I was trying to update my main app code to utilize the .Net Framework 4.0 and this happened:</p>
<p><strong>The Problem:</strong> I could find no obvious way to update the mscorlib reference in my solution, so I decide to simply delete it and add it again, and hope that it magically updates to the most recent version.  This is actually what usually happens with Visual Studio.  However, I delete the mscorlib reference, and I am unable to add it back again, I get the error message telling me that mscorlib is already included in the project.</p>
<p><strong>The Cause:</strong> This is a known problem in Visual Studio.</p>
<p><strong>The Solution:</strong> I just went into my project (.csproj) file and added the following line</p>
<blockquote><p>&lt;Reference Include=&#8221;mscorlib&#8221; /&gt;</p></blockquote>
<p>And that fixed it.  I still have no idea how to make it use the most recent .Net Framework though.</p>
<p><small><a title="Attribution-NoDerivs License" href="http://creativecommons.org/licenses/by-nd/2.0/" target="_blank"><img src="http://blog.stronico.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="dasapfe" href="http://www.flickr.com/photos/15304862@N04/4650722495/" target="_blank">dasapfe</a></small></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=523&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/07/how-to-fix-a-missing-reference-to-mscorlib-in-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple way to create a Microsoft Word document from a template in Asp.net/C#</title>
		<link>http://blog.stronico.com/2010/07/a-simple-way-to-create-a-microsoft-word-document-from-a-template-in-asp-netc/</link>
		<comments>http://blog.stronico.com/2010/07/a-simple-way-to-create-a-microsoft-word-document-from-a-template-in-asp-netc/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 16:32:52 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[ASP.net MVC]]></category>
		<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[How To Fix]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=500</guid>
		<description><![CDATA[<p><a title="Will code for food" href="http://www.flickr.com/photos/67523311@N00/114420037/" target="_blank"><img class="alignright" style="border: 0px initial initial;" src="http://farm1.static.flickr.com/45/114420037_f08201d9b8_m.jpg" border="0" alt="Will code for food" width="240" height="180" align="center" /></a> I recently had the need to create a Microsoft Word document from a template.  I initially tried using Office Web Components and Interop but all that really wasn&#8217;t worth the trouble.  I wound up doing global replacements in the html of html   Here is how I did it:</p>
<p><a href="http://blog.stronico.com/2010/07/a-simple-way-to-create-a-microsoft-word-document-from-a-template-in-asp-netc/" class="more-link">Read more on A simple way to create a Microsoft Word document from a template in Asp.net/C#&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=500&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><a title="Will code for food" href="http://www.flickr.com/photos/67523311@N00/114420037/" target="_blank"><img class="alignright" style="border: 0px initial initial;" src="http://farm1.static.flickr.com/45/114420037_f08201d9b8_m.jpg" border="0" alt="Will code for food" width="240" height="180" align="center" /></a> I recently had the need to create a Microsoft Word document from a template.  I initially tried using Office Web Components and Interop but all that really wasn&#8217;t worth the trouble.  I wound up doing global replacements in the html of html   Here is how I did it:</p>
<ol>
<li>Open up your template document in word, and put any target areas in special Brackets, the text would read something like &#8220;I, [FULLNAME] do hereby affirm that&#8221;.  I found that the target area had to be in uppercase, I&#8217;m not sure why</li>
<li>Go to &#8220;Save As Html, Filtered&#8221;, and save it in a writeable directory.</li>
<li>In your C# code, first load the entire document into a string</li>
<li>Convert that string into an instance of StringBuilder</li>
<li>Use the StringBuilder Replace function, it would look something like this &#8211;  sb.Replace(&#8220;[FULLNAME]&#8220;, strFullName);</li>
<li>Create a TextWriter, and write the StringBuilder to it &#8211; make sure you&#8217;re saving it with a &#8220;.doc&#8221; extension.</li>
<li>Close the TextWriter</li>
</ol>
<p>All told, the code looks like this</p>
<blockquote>
<div id="_mcePaste">//Create a new filename</div>
<div id="_mcePaste">string strFileName = System.Guid.NewGuid().ToString();</div>
<div id="_mcePaste">string strPathRoot = &#8220;d:\\domains\\MyDomain\\Word\\&#8221;;</div>
<div id="_mcePaste">string strPath = strPathRoot + &#8220;TemplateHtml.doc&#8221;;</div>
<div id="_mcePaste">string str = System.IO.File.ReadAllText(strPath);</div>
<div id="_mcePaste">StringBuilder sb = new StringBuilder();</div>
<div id="_mcePaste">sb.AppendLine(s);</div>
<div id="_mcePaste">//replace the text</div>
<div id="_mcePaste">sb.Replace(&#8220;[FULLNAME]&#8220;, strFullName);</div>
<div id="_mcePaste">//save it out</div>
<div id="_mcePaste">TextWriter tw = new StreamWriter(strPathRoot + strFileName + &#8220;.doc&#8221;);</div>
<div id="_mcePaste">// write a line of text to the file</div>
<div id="_mcePaste">tw.WriteLine(sb.ToString());</div>
<div id="_mcePaste">// close it</div>
<div id="_mcePaste">tw.Close();</div>
<div id="_mcePaste">tw.Dispose();</div>
</blockquote>
<p>That&#8217;s it!</p>
<p><small><a title="Attribution License" href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://blog.stronico.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a></small><br />
<small><a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="pvera" href="http://www.flickr.com/photos/67523311@N00/114420037/" target="_blank">pvera</a></small></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=500&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/07/a-simple-way-to-create-a-microsoft-word-document-from-a-template-in-asp-netc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix the &#8220;The service cannot be activated because it requires ASP.NET compatibility&#8221; error</title>
		<link>http://blog.stronico.com/2010/06/how-to-fix-the-the-service-cannot-be-activated-because-it-requires-asp-net-compatibility-error/</link>
		<comments>http://blog.stronico.com/2010/06/how-to-fix-the-the-service-cannot-be-activated-because-it-requires-asp-net-compatibility-error/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 17:50:48 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[How To Fix]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=475</guid>
		<description><![CDATA[<p><strong>The Problem:</strong> You try to access your web service on IIS 7 and you get the following error</p>
<blockquote><p>The service cannot be activated because it requires ASP.NET compatibility. ASP.NET compatibility is not enabled for this application. Either enable ASP.NET compatibility in web.config or set the AspNetCompatibilityRequirementsAttribute.AspNetCompatibilityRequirementsMode property to a value other than Required.<br />
at System.ServiceModel.Activation.HostedAspNetEnvironment.ValidateCompatibilityRequirements(AspNetCompatibilityRequirementsMode compatibilityMode) at System.ServiceModel.Activation.AspNetCompatibilityRequirementsAttribute.System.ServiceModel.Description.IServiceBehavior.Validate(ServiceDescription description, ServiceHostBase serviceHostBase) at System.ServiceModel.Description.DispatcherBuilder.ValidateDescription(ServiceDescription description, ServiceHostBase serviceHost) at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) at System.ServiceModel.ServiceHostBase.InitializeRuntime() at System.ServiceModel.ServiceHostBase.OnBeginOpen() at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open() at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)</p></blockquote>
<p><strong><span id="more-475"></span>The Cause:</strong> A generic Google search will tell you to check the AspNetCompatibilityMode in your web service (.svc) file, specifically to change it from</p>
<p><a href="http://blog.stronico.com/2010/06/how-to-fix-the-the-service-cannot-be-activated-because-it-requires-asp-net-compatibility-error/" class="more-link">Read more on How to fix the &#8220;The service cannot be activated because it requires ASP.NET compatibility&#8221; error&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=475&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><strong>The Problem:</strong> You try to access your web service on IIS 7 and you get the following error</p>
<blockquote><p>The service cannot be activated because it requires ASP.NET compatibility. ASP.NET compatibility is not enabled for this application. Either enable ASP.NET compatibility in web.config or set the AspNetCompatibilityRequirementsAttribute.AspNetCompatibilityRequirementsMode property to a value other than Required.<br />
at System.ServiceModel.Activation.HostedAspNetEnvironment.ValidateCompatibilityRequirements(AspNetCompatibilityRequirementsMode compatibilityMode) at System.ServiceModel.Activation.AspNetCompatibilityRequirementsAttribute.System.ServiceModel.Description.IServiceBehavior.Validate(ServiceDescription description, ServiceHostBase serviceHostBase) at System.ServiceModel.Description.DispatcherBuilder.ValidateDescription(ServiceDescription description, ServiceHostBase serviceHost) at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) at System.ServiceModel.ServiceHostBase.InitializeRuntime() at System.ServiceModel.ServiceHostBase.OnBeginOpen() at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open() at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)</p></blockquote>
<p><strong><span id="more-475"></span>The Cause:</strong> A generic Google search will tell you to check the AspNetCompatibilityMode in your web service (.svc) file, specifically to change it from</p>
<blockquote><p>[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]</p>
<p>to</p>
<p>[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]</p></blockquote>
<p>However, before you do that, make sure that the web.config file actually exists in the web directory where the application actually resides.  If the web.config file is not there at all it will throw the same error as if there was the compatibility error in the web.config file itself.</p>
<p><strong>The Solution:</strong> In my case I was publishing the same website in a variety of slightly different directories, and due to a bug in my publishing system the web.config file was not copied over to the final, production directory.   Surprisingly the application (a Silverlight application in this case) was able to run without the web.config being there, but none of the web services would work.</p>
<p>The lesson is, before you delve into the web.config file too deeply, make sure that the file exists.</p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=475&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/06/how-to-fix-the-the-service-cannot-be-activated-because-it-requires-asp-net-compatibility-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix the &#8220;550 Requested action not taken: mailbox unavailable or not local&#8221; email problem</title>
		<link>http://blog.stronico.com/2010/06/how-to-fix-the-550-requested-action-not-taken-mailbox-unavailable-or-not-local-email-problem/</link>
		<comments>http://blog.stronico.com/2010/06/how-to-fix-the-550-requested-action-not-taken-mailbox-unavailable-or-not-local-email-problem/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 19:42:49 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[How To Fix]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=467</guid>
		<description><![CDATA[<p><a title="Lost: Remote Control" href="http://www.flickr.com/photos/76006006@N00/308616505/" target="_blank"><img class="alignright" style="border: 0px initial initial;" src="http://farm1.static.flickr.com/109/308616505_758379f885_m.jpg" border="0" alt="Lost: Remote Control" width="180" height="240" /></a><strong>The Problem:</strong> You send an email to someone and get the following back</p>
<blockquote><p>Your message did not reach some or all of the intended recipients.</p>
<p>Subject:    Any Subject</p>
<p>Sent: 6/4/2010 2:31 PM</p></blockquote>
<p><a href="http://blog.stronico.com/2010/06/how-to-fix-the-550-requested-action-not-taken-mailbox-unavailable-or-not-local-email-problem/" class="more-link">Read more on How to fix the &#8220;550 Requested action not taken: mailbox unavailable or not local&#8221; email problem&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=467&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><a title="Lost: Remote Control" href="http://www.flickr.com/photos/76006006@N00/308616505/" target="_blank"><img class="alignright" style="border: 0px initial initial;" src="http://farm1.static.flickr.com/109/308616505_758379f885_m.jpg" border="0" alt="Lost: Remote Control" width="180" height="240" /></a><strong>The Problem:</strong> You send an email to someone and get the following back</p>
<blockquote><p>Your message did not reach some or all of the intended recipients.</p>
<p>Subject:    Any Subject</p>
<p>Sent: 6/4/2010 2:31 PM</p>
<p>The following recipient(s) cannot be reached:</p>
<p>This User on 6/4/2010 2:31 PM</p>
<p>Server error: &#8216;550 Requested action not taken: mailbox unavailable or not local&#8217;</p></blockquote>
<p><strong>The Cause:</strong> Both sender and recipient are on the same mail server, but the recipient&#8217;s mail server is hosted by Google Apps (or some other mail server).  Your smtp server makes a preliminary request to the wrong server, and causes this false error message.</p>
<p><strong>The Solution:</strong> The recipient (who has the mail server hosted by Google Apps) needs to disable mail services for their domain.  You can do it in IIS directly (assuming you are running Windows).  In Plesk simply go to Domains &gt; Mail &gt; Disable Mail</p>
<p><small><a title="Attribution License" href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://blog.stronico.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="jaqian" href="http://www.flickr.com/photos/76006006@N00/308616505/" target="_blank">jaqian</a></small></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=467&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/06/how-to-fix-the-550-requested-action-not-taken-mailbox-unavailable-or-not-local-email-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Fix: Canonical Urls with IIS 7&#8217;s Url Rewrite feature for https</title>
		<link>http://blog.stronico.com/2010/06/how-to-fix-canonical-urls-with-iis-7s-url-rewrite-feature-for-https/</link>
		<comments>http://blog.stronico.com/2010/06/how-to-fix-canonical-urls-with-iis-7s-url-rewrite-feature-for-https/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 22:24:06 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[ASP.net MVC]]></category>
		<category><![CDATA[How To Fix]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=462</guid>
		<description><![CDATA[<p><a title="SATOR Magic square" href="http://www.flickr.com/photos/45035549@N00/287007410/" target="_blank"><img class="alignright" style="border: 0px initial initial;" src="http://farm1.static.flickr.com/119/287007410_3520a789d7_m.jpg" border="0" alt="SATOR Magic square" width="240" height="240" /></a><strong>The Problem:</strong> You want to make your website all SEO friendly by creating a single, canonical url.  For example, if someone types in <a href="http://stronico.com" target="_blank">http://www.stronico.com</a>, you want them to be redirected to <a href="http://stronico.com" target="_blank">http://stronico.com</a> (Google likes it this way).  You do some research and discover that all of the default code and documentation for handling canonical Urls in IIS 7 uses web.config files and the URL Rewrite application program.  All is well and good so far, but what if you use SSL?  The stock code will always redirect you to <a href="https://stronico.com" target="_blank">http://stronico.com/Signup/</a> even if the original url was <a href="https://stronico.com">https://stronico.com/Signup/</a> (note the https).<span id="more-462"></span></p>
<p><a href="http://blog.stronico.com/2010/06/how-to-fix-canonical-urls-with-iis-7s-url-rewrite-feature-for-https/" class="more-link">Read more on How to Fix: Canonical Urls with IIS 7&#8217;s Url Rewrite feature for https&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=462&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><a title="SATOR Magic square" href="http://www.flickr.com/photos/45035549@N00/287007410/" target="_blank"><img class="alignright" style="border: 0px initial initial;" src="http://farm1.static.flickr.com/119/287007410_3520a789d7_m.jpg" border="0" alt="SATOR Magic square" width="240" height="240" /></a><strong>The Problem:</strong> You want to make your website all SEO friendly by creating a single, canonical url.  For example, if someone types in <a href="http://stronico.com" target="_blank">http://www.stronico.com</a>, you want them to be redirected to <a href="http://stronico.com" target="_blank">http://stronico.com</a> (Google likes it this way).  You do some research and discover that all of the default code and documentation for handling canonical Urls in IIS 7 uses web.config files and the URL Rewrite application program.  All is well and good so far, but what if you use SSL?  The stock code will always redirect you to <a href="https://stronico.com" target="_blank">http://stronico.com/Signup/</a> even if the original url was <a href="https://stronico.com">https://stronico.com/Signup/</a> (note the https).<span id="more-462"></span></p>
<p><strong>The Cause:</strong> URL Rewrite is new, and it was an oversight on Microsoft&#8217;s part.</p>
<p><strong>The Solution:</strong> You have to use two rules, first checking to see if the url contains the https.  Here is a sample below</p>
<blockquote><p>&lt;rewrite&gt;<br />
&lt;rules&gt;<br />
&lt;rule name=&#8221;Canonical Hostname &#8211; No HTTPS&#8221;&gt;<br />
&lt;match url=&#8221;(.*)&#8221; /&gt;<br />
&lt;conditions logicalGrouping=&#8221;MatchAll&#8221; trackAllCaptures=&#8221;false&#8221;&gt;<br />
&lt;add input=&#8221;{HTTPS}&#8221; pattern=&#8221;OFF&#8221; /&gt;<br />
&lt;add input=&#8221;{HTTP_HOST}&#8221; pattern=&#8221;^stronico\.com$&#8221; negate=&#8221;true&#8221; /&gt;<br />
&lt;/conditions&gt;<br />
&lt;action type=&#8221;Redirect&#8221; url=&#8221;http://stronico.com/{R:1}&#8221; /&gt;<br />
&lt;/rule&gt;<br />
&lt;rule name=&#8221;Canonical Hostname &#8211; With HTTPS&#8221;&gt;<br />
&lt;match url=&#8221;(.*)&#8221; /&gt;<br />
&lt;conditions logicalGrouping=&#8221;MatchAll&#8221; trackAllCaptures=&#8221;false&#8221;&gt;<br />
&lt;add input=&#8221;{HTTPS}&#8221; pattern=&#8221;ON&#8221; /&gt;<br />
&lt;add input=&#8221;{HTTP_HOST}&#8221; pattern=&#8221;^stronico\.com$&#8221; negate=&#8221;true&#8221; /&gt;<br />
&lt;/conditions&gt;<br />
&lt;action type=&#8221;Redirect&#8221; url=&#8221;https://stronico.com/{R:1}&#8221; /&gt;<br />
&lt;/rule&gt;<br />
&lt;/rules&gt;<br />
&lt;/rewrite&gt;</p></blockquote>
<p>That&#8217;s it!  It took me an embarassingly long time to figure that one out.<br />
<small><a title="Attribution License" href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://blog.stronico.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="Marco Fedele" href="http://www.flickr.com/photos/45035549@N00/287007410/" target="_blank">Marco Fedele</a></small></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=462&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/06/how-to-fix-canonical-urls-with-iis-7s-url-rewrite-feature-for-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix the 550 #5.1.0 Address rejected email problem</title>
		<link>http://blog.stronico.com/2010/03/how-to-fix-the-550-5-1-0-address-rejected-email-problem/</link>
		<comments>http://blog.stronico.com/2010/03/how-to-fix-the-550-5-1-0-address-rejected-email-problem/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 16:25:06 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[How To Fix]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=292</guid>
		<description><![CDATA[<p><a title="email_subscribe" href="http://www.flickr.com/photos/15319336@N07/2060971239/" target="_blank"><img src="http://farm3.static.flickr.com/2024/2060971239_d3c1ecce02_m.jpg" border="0" alt="email_subscribe" align="right" /></a><strong>The Problem:</strong> All email that you send get&#8217;s bounced back with the following message:</p>
<blockquote><p>Subject Line: Delivery Status Notification (Failure)<br />
Message: Delivery to the following recipient failed permanently:<br />
user@domain.com<br />
Technical details of permanent failure:<br />
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 #5.1.0 Address rejected user@domain.com (state 14).</p></blockquote>
<p><strong>The Cause:</strong> There is no &#8220;mail.domain.com&#8221; in the dns system.  In my case I was sending the mail via an alias (it was a notification email from the web server).  The receiving mail server sees the email as forged and bounces it.</p>
<p><a href="http://blog.stronico.com/2010/03/how-to-fix-the-550-5-1-0-address-rejected-email-problem/" class="more-link">Read more on How to fix the 550 #5.1.0 Address rejected email problem&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=292&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><a title="email_subscribe" href="http://www.flickr.com/photos/15319336@N07/2060971239/" target="_blank"><img src="http://farm3.static.flickr.com/2024/2060971239_d3c1ecce02_m.jpg" border="0" alt="email_subscribe" align="right" /></a><strong>The Problem:</strong> All email that you send get&#8217;s bounced back with the following message:</p>
<blockquote><p>Subject Line: Delivery Status Notification (Failure)<br />
Message: Delivery to the following recipient failed permanently:<br />
user@domain.com<br />
Technical details of permanent failure:<br />
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 #5.1.0 Address rejected user@domain.com (state 14).</p></blockquote>
<p><strong>The Cause:</strong> There is no &#8220;mail.domain.com&#8221; in the dns system.  In my case I was sending the mail via an alias (it was a notification email from the web server).  The receiving mail server sees the email as forged and bounces it.</p>
<p><strong>The Solution:</strong> Go to the dns system and create a mail.domain.com and point your MX records to that.  It&#8217;s a bit silly, but it has to be done that way.</p>
<p><small><a title="Attribution License" href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://blog.stronico.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="derrickkwa" href="http://www.flickr.com/photos/15319336@N07/2060971239/" target="_blank">derrickkwa</a></small></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=292&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/03/how-to-fix-the-550-5-1-0-address-rejected-email-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix updating problems in your Silverlight application</title>
		<link>http://blog.stronico.com/2010/03/how-to-fix-updating-problems-in-your-silverlight-application/</link>
		<comments>http://blog.stronico.com/2010/03/how-to-fix-updating-problems-in-your-silverlight-application/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 17:51:28 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[How To Fix]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=282</guid>
		<description><![CDATA[<p><strong>The Problem:</strong> You make changes to your Silverlight Application, but you do not see it reflected when you debug or run the solution.<a title="2cv_phil_repair_small" href="http://www.flickr.com/photos/64588110@N00/8206134/" target="_blank"><img class="alignright" style="border: 0pt none;" src="http://farm1.static.flickr.com/5/8206134_e3df7a23d7_m.jpg" border="0" alt="2cv_phil_repair_small" width="160" height="240" /></a></p>
<p><strong>The Cause:</strong> While the web project portion of the solution is being compiled and run, the Silverlight project is not being built.  This just happened to me recently.  Visual Studio crashed and somehow the Silverlight project portion of the solution decided to remove itself from the build list.</p>
<p><a href="http://blog.stronico.com/2010/03/how-to-fix-updating-problems-in-your-silverlight-application/" class="more-link">Read more on How to fix updating problems in your Silverlight application&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=282&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><strong>The Problem:</strong> You make changes to your Silverlight Application, but you do not see it reflected when you debug or run the solution.<a title="2cv_phil_repair_small" href="http://www.flickr.com/photos/64588110@N00/8206134/" target="_blank"><img class="alignright" style="border: 0pt none;" src="http://farm1.static.flickr.com/5/8206134_e3df7a23d7_m.jpg" border="0" alt="2cv_phil_repair_small" width="160" height="240" /></a></p>
<p><strong>The Cause:</strong> While the web project portion of the solution is being compiled and run, the Silverlight project is not being built.  This just happened to me recently.  Visual Studio crashed and somehow the Silverlight project portion of the solution decided to remove itself from the build list.</p>
<p><strong>The Solution: </strong> Right-Click on the solution, then select &#8220;Configuration manager&#8221;.  Make sure that the &#8220;Build&#8221; checkbox is selected for both projects.  That&#8217;s it!</p>
<p><small><a title="Attribution License" href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://blog.stronico.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="Mooganic" href="http://www.flickr.com/photos/64588110@N00/8206134/" target="_blank">Mooganic</a></small></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=282&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/03/how-to-fix-updating-problems-in-your-silverlight-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix strange errors in silverlight web services</title>
		<link>http://blog.stronico.com/2010/03/how-to-fix-strange-errors-in-silverlight-web-services/</link>
		<comments>http://blog.stronico.com/2010/03/how-to-fix-strange-errors-in-silverlight-web-services/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 16:11:14 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[How To Fix]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=279</guid>
		<description><![CDATA[<p><a title="fix you_small" href="http://www.flickr.com/photos/57034478@N00/137756118/" target="_blank"><img class="alignright" style="border: 0pt none;" src="http://farm1.static.flickr.com/54/137756118_f74889ca84_m.jpg" border="0" alt="fix you_small" width="240" height="203" /></a><strong>The Problem:</strong> You upload your wonderful Silverlight application to a new server and begin to get all sorts of strange errors, most notably something like this</p>
<blockquote><p>Message: Unhandled Error in Silverlight 2 Application An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()<br />
at StronicoMain.ServerUtil.AddressTypeListCompletedEventArgs.get_Result()<br />
at StronicoMain.Page.proxy_AddressTypeListCompleted(Object sender, AddressTypeListCompletedEventArgs e)<br />
at StronicoMain.ServerUtil.ServerUtilClient.OnAddressTypeListCompleted(Object state)<br />
Line: 1<br />
Char: 1<br />
Code: 0<br />
URI: http://www.servername.com/Silverlight.js</p></blockquote>
<p><span id="more-279"></span>You spend an hour or so trying to decifer the InnerException, which gives you no useful information.  You then try to access the web service via a web browser, like http://www.servername.com/MyService.svc, and you get a 404 error.  You then add that to the mime type list and still the problem is not fixed.</p>
<p><a href="http://blog.stronico.com/2010/03/how-to-fix-strange-errors-in-silverlight-web-services/" class="more-link">Read more on How to fix strange errors in silverlight web services&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=279&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><a title="fix you_small" href="http://www.flickr.com/photos/57034478@N00/137756118/" target="_blank"><img class="alignright" style="border: 0pt none;" src="http://farm1.static.flickr.com/54/137756118_f74889ca84_m.jpg" border="0" alt="fix you_small" width="240" height="203" /></a><strong>The Problem:</strong> You upload your wonderful Silverlight application to a new server and begin to get all sorts of strange errors, most notably something like this</p>
<blockquote><p>Message: Unhandled Error in Silverlight 2 Application An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()<br />
at StronicoMain.ServerUtil.AddressTypeListCompletedEventArgs.get_Result()<br />
at StronicoMain.Page.proxy_AddressTypeListCompleted(Object sender, AddressTypeListCompletedEventArgs e)<br />
at StronicoMain.ServerUtil.ServerUtilClient.OnAddressTypeListCompleted(Object state)<br />
Line: 1<br />
Char: 1<br />
Code: 0<br />
URI: http://www.servername.com/Silverlight.js</p></blockquote>
<p><span id="more-279"></span>You spend an hour or so trying to decifer the InnerException, which gives you no useful information.  You then try to access the web service via a web browser, like http://www.servername.com/MyService.svc, and you get a 404 error.  You then add that to the mime type list and still the problem is not fixed.</p>
<p><strong>The Cause:</strong> Your WCF services are not mapping properly to the IIS 7 metabase.</p>
<p><strong>The Solution:</strong> Run the following command &#8220;%Windir%\Microsoft.Net\Framework\v3.0\Windows Communication  Foundation\ServiceModelReg.exe -r&#8221; in a command prompt.  That clears everything up.  <a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b5e3658e-d78c-4c42-967e-9bcd88b4e3a1" target="_blank">Please see this page on social.msdn.microsoft.com</a> for more information.</p>
<p><small><a href="http://www.photodropper.com/photos/" target="_blank"><img src="http://blog.stronico.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" />photo</a> credit: <a title="ⓙanet" href="http://www.flickr.com/photos/57034478@N00/137756118/" target="_blank">ⓙanet</a></small></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=279&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/03/how-to-fix-strange-errors-in-silverlight-web-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to automatically start a program in the tray</title>
		<link>http://blog.stronico.com/2010/02/how-to-automatically-start-a-program-in-the-tray/</link>
		<comments>http://blog.stronico.com/2010/02/how-to-automatically-start-a-program-in-the-tray/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 22:41:54 +0000</pubDate>
		<dc:creator>Steve French</dc:creator>
				<category><![CDATA[How To Fix]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://blog.stronico.com/?p=260</guid>
		<description><![CDATA[<p><strong>The Problem:</strong> There is no way to start a program minimized in the system tray</p>
<p><strong>The Cause:</strong> The correct event is the Shown event, which is not intuitive (to me anyway).</p>
<p><a href="http://blog.stronico.com/2010/02/how-to-automatically-start-a-program-in-the-tray/" class="more-link">Read more on How to automatically start a program in the tray&#8230;</a></p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&#038;id=260&#038;type=feed" alt="" />]]></description>
			<content:encoded><![CDATA[<p><strong>The Problem:</strong> There is no way to start a program minimized in the system tray</p>
<p><strong>The Cause:</strong> The correct event is the Shown event, which is not intuitive (to me anyway).</p>
<p><strong>The Solution:</strong> Just add in the following code:</p>
<blockquote><p>private void MyForm_Resize(object sender, EventArgs e)<br />
{<br />
if (FormWindowState.Minimized == WindowState)<br />
{<br />
Hide();<br />
}<br />
}</p>
<p>private void MyForm_Load(object sender, EventArgs e)<br />
{<br />
this.Hide();<br />
}<br />
private void MyForm_Shown(object sender, EventArgs e)<br />
{<br />
WindowState = FormWindowState.Minimized;<br />
Hide();<br />
}</p></blockquote>
<p>and you&#8217;re done!  You can then the start the program and it will automatically minimnize itself to the tray.</p>
<img src="http://blog.stronico.com/?ak_action=api_record_view&id=260&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.stronico.com/2010/02/how-to-automatically-start-a-program-in-the-tray/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
