<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Dave Kidder&amp;#39;s Break-it-Down Blog</title><subtitle type="html">Breaking down different aspects of Visual Studio LightSwitch publishing...and whatever I learn along the way</subtitle><id>http://blogs.msdn.com/b/david_kidder/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/david_kidder/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/david_kidder/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2012-03-05T04:19:52Z</updated><entry><title>How to Run a LightSwitch App in Azure without HTTPS (V3 Apps Only)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/david_kidder/archive/2013/03/29/how-to-run-a-lightswitch-app-in-azure-without-https-v3-apps-only.aspx" /><id>http://blogs.msdn.com/b/david_kidder/archive/2013/03/29/how-to-run-a-lightswitch-app-in-azure-without-https-v3-apps-only.aspx</id><published>2013-03-29T14:42:00Z</published><updated>2013-03-29T14:42:00Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt;&amp;nbsp; We recommend that you use HTTPS for applications deployed in production and that the approach outlined below only be used for testing purposes.&amp;nbsp; I will work on getting something posted about SSL Certificates and LightSwitch apps, as I am not finding anything straight-forward with a quick search.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;Currently when you go down the &amp;ldquo;Azure &amp;gt;&amp;gt; Cloud Service&amp;rdquo; path in the LightSwitch Publish Wizard, you will run into this tab on the &amp;ldquo;Security Settings&amp;rdquo; page:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/1261.image_5F00_61A58B6A.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/2235.image_5F00_thumb_5F00_79C8F5C5.png" alt="image" width="793" height="556" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;Unlike the IIS or Azure Web Site paths, you don&amp;rsquo;t get to choose whether or not you want to use HTTPS, it&amp;rsquo;s required and you have to pick a certificate (I won&amp;rsquo;t go into why, as this was implemented before I started on the team so I wasn&amp;rsquo;t there for the discussions).&amp;nbsp; One significant problem that this requirement leads to is that attempting to launch an out-of-browser app that is configured to use HTTPS will fail if you are using a self-signed certificate:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: x-small;"&gt;&amp;ldquo;An error occurred while checking for updates.&amp;nbsp; Make sure you are running the latest version of the application by uninstalling it from Add/Remove Programs in the Control Panel, and then re-installing the application.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: x-small;"&gt;Details:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: x-small;"&gt;Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)&amp;rdquo;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;In VS Update 2 CTP 4, we have introduced a runtime setting that will allow you to run without HTTPS.&amp;nbsp; No changes were made to the Publish Wizard at this time so it will still require that you specify a certificate, but if you follow the steps below HTTPS will not be used.&amp;nbsp; &lt;strong&gt;Note&lt;/strong&gt; that the changes are for &lt;span style="text-decoration: underline;"&gt;&amp;ldquo;V3&amp;rdquo; projects only&lt;/span&gt;, so you will need to right-click on the LightSwitch project in Solution Explorer and choose &amp;ldquo;Upgrade Project&amp;rdquo; in order for this setting to work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;You will need to edit 3 files to make this happen.&amp;nbsp; Start by switching to &amp;ldquo;File View&amp;rdquo; in Solution Explorer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;First open the &lt;strong&gt;web.config&lt;/strong&gt; file located in the Server sub-project and update this setting:&lt;/span&gt;&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 81.83%; height: 65px; text-align: left; line-height: 12pt; overflow: auto; font-family: 'Courier New', courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: #f4f4f4;"&gt;
&lt;pre id="codeSnippet" style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: 'Courier New', courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.RequireEncryption"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="&lt;strong&gt;&lt;span style="background-color: #ffff00;"&gt;f&lt;/span&gt;&lt;span style="background-color: #ffff00;"&gt;alse&lt;/span&gt;&lt;/strong&gt;"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;Next, open the &lt;strong&gt;ServiceDefinition.csdef&lt;/strong&gt; file located under the root LightSwitch project and add this setting to the &lt;strong&gt;ConfigurationSettings&lt;/strong&gt; node:&lt;/span&gt;&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 82.41%; height: 167px; text-align: left; line-height: 12pt; overflow: auto; font-family: 'Courier New', courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: #f4f4f4;"&gt;
&lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: 'Courier New', courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;ConfigurationSettings&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.Enabled"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.LocalOnly"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.Level"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.Sensitive"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.Categories"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;/pre&gt;
&lt;span style="background-color: #ffff00;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;/span&gt;
&lt;pre id="codeSnippet" style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: 'Courier New', courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;&lt;span style="background-color: #ffff00;"&gt;="Microsoft.LightSwitch.RequireEncryption&lt;/span&gt;"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;ConfigurationSettings&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;Finally, open the &lt;strong&gt;ServiceConfiguration.cscfg&lt;/strong&gt; file located under the root LightSwitch project and add this setting to the &lt;strong&gt;ConfigurationSettings&lt;/strong&gt; node:&lt;/span&gt;&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: 'Courier New', courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: #f4f4f4;"&gt;
&lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: 'Courier New', courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;ConfigurationSettings&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.Enabled"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="false"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.LocalOnly"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="true"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.Level"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Information"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.Sensitive"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="false"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.Trace.Categories"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;/pre&gt;
&lt;span style="background-color: #ffff00;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Setting&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Microsoft.LightSwitch.RequireEncryption"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="false"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;
&lt;pre id="codeSnippet" style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: 'Courier New', courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;ConfigurationSettings&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;Save all these files, then re-publish.&amp;nbsp; To reiterate, you still need to specify a certificate although it won&amp;rsquo;t actually be used.&amp;nbsp; Create a new self-signed certificate through the publish wizard if you haven&amp;rsquo;t done this already.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;Once the app is done publishing, browse to the site and you will notice that you&amp;rsquo;re hitting an HTTP URL instead of HTTPS.&amp;nbsp; You should now be able to install your out-of-browser app successfully.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;If you navigate to your Cloud Service in the Azure Management Portal and click on the &amp;ldquo;Configure&amp;rdquo; tab, you will see this new setting (and all the ones that were previously defined in the csdef/cscfg files) are here and available to update via the portal:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/4478.image_5F00_66A7C919.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/7534.image_5F00_thumb_5F00_5F1C59AC.png" alt="image" width="695" height="275" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;In the future we hope to get around to adding support in the Publish Wizard to let you choose whether or not to use HTTPS in the Cloud Service path, but for now, this should get you around the out-of-browser issue.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10406298" width="1" height="1"&gt;</content><author><name>Dave Kidder</name><uri>http://blogs.msdn.com/grandmasterchuckwagon_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Avoid LightSwitch URI Casing Issue Using the URL Rewrite Module</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/david_kidder/archive/2013/01/26/avoid-lightswitch-uri-casing-issue-using-the-url-rewrite-module.aspx" /><id>http://blogs.msdn.com/b/david_kidder/archive/2013/01/26/avoid-lightswitch-uri-casing-issue-using-the-url-rewrite-module.aspx</id><published>2013-01-26T22:45:10Z</published><updated>2013-01-26T22:45:10Z</updated><content type="html">&lt;p&gt;Late last year, some customers on the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/lightswitch/threads" target="_blank"&gt;LightSwitch forums&lt;/a&gt; started reporting an issue that certain situations would cause an error with the message:&lt;/p&gt;  &lt;p&gt;“The context is already tracking a different entity with the same resource Uri.”&lt;/p&gt;  &lt;p&gt; or &lt;/p&gt;  &lt;p&gt;“An error occurred while processing this request.”&amp;#160; &lt;/p&gt;  &lt;p&gt;One of the ways that this could repro was if the user changed a value on the first page of records on an editable grid form, went to the next page (without saving first) then paged back to the previous page.&amp;#160; When this happened, the record would appear with its old value and wouldn’t have the * next to it to indicate that the record was modified.&amp;#160; If you hit Save at this point, you’d get an error that read “An error occurred while processing this request”.&amp;#160; The problem wouldn’t repro all the time for all users (always fun times for a tester), but we eventually figured out that the problem would occur if the casing of the application name differed between what the user had entered in the browser and what the application had been named on the IIS Server.&lt;/p&gt;  &lt;p&gt;For example, if I had deployed my LightSwitch app by setting the Site/Application field in the publish wizard like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/7737.image_5F00_3F837C74.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/4682.image_5F00_thumb_5F00_57A6E6CF.png" width="623" height="355" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;…then the application would have the casing “SchoolBooks” on the web server and entities returned from the server would have this casing in their URI.&amp;#160; If a client uses the URL http://myserver/SchoolBooks to launch the application, everything goes swimmingly and users won’t hit the errors mentioned above.&amp;#160; If, however, the user entered http://myserver/schoolbooks (all lowercase) then the trouble starts.&lt;/p&gt;  &lt;p&gt;The issue is not specific to LightSwitch and the underlying cause is a well-known issue in the WCF Data Services stack regarding case sensitivity.&amp;#160; At the time we found the issue being reported on the LightSwitch forums, our guidance was to make sure the users entered the correctly cased URL when launching the application.&amp;#160; This obviously is less than ideal as you have no control over what users will enter.&lt;/p&gt;  &lt;p&gt;One way to assure that the client &lt;em&gt;does&lt;/em&gt; supply the correct URL when the application is launched is to use the &lt;a href="http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module" target="_blank"&gt;IIS URL Rewrite Module&lt;/a&gt;.&amp;#160; This module can do all kinds of cool stuff, but for our purposes it can help us by redirecting requests that come in with the “wrong” casing to the one we want.&amp;#160; It does this by using a system that allows the administrator to define a set of rules to detect incoming URLs and rewrite or redirect them, in certain situations.&lt;/p&gt;  &lt;p&gt;First, &lt;a href="http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module" target="_blank"&gt;install the module&lt;/a&gt; so you can use it in IIS (note that you need IIS 7.0 or higher).&amp;#160; After installing, open IIS Manager, click on the website that you need to create the redirect rule for:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/3000.image_5F00_4BA4F69B.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/2133.image_5F00_thumb_5F00_044FA0A9.png" width="362" height="106" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You should now see “URL Rewrite” in the “IIS” section of the features pane, double-click on it…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/2438.image_5F00_719AA6F1.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/5756.image_5F00_thumb_5F00_551DB511.png" width="370" height="219" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;…then pick “Add Rule(s)” under the “Actions” pane on the far right:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/7384.image_5F00_3B497EE2.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/4336.image_5F00_thumb_5F00_4F629B6B.png" width="359" height="156" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;On the “Add Rule(s)” dialog, pick “Blank rule” from the “Inbound rules” section and hit OK&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/7776.image_5F00_4E8A3581.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/0028.image_5F00_thumb_5F00_392C8019.png" width="470" height="140" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now we’ll fill out the info for the rule.&amp;#160; First, name the rule (I’ll just name mine the name of my app) and enter the pattern as I have done below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/4130.image_5F00_0D7BB61D.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/8053.image_5F00_thumb_5F00_05F046B0.png" width="589" height="304" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The Pattern field is where we put the regular expression that we want to match on.&amp;#160; Note that since we created this rule at the “Default Web Site” level, the URL that we’re checking will be relative to that (i.e. we don’t have to worry about the web site name, only what comes after the initial slash).&amp;#160; The pattern that I have entered above means that it will match when the URL begins with “schoolbooks” (case &lt;u&gt;insensitive&lt;/u&gt;, since “Ignore case” is &lt;strong&gt;checked&lt;/strong&gt;).&amp;#160; The (.*) at the end will capture the remaining string in the URL (we’ll need that later when we specify our redirect URL).&lt;/p&gt;  &lt;p&gt;We now need to enter a “Condition” to our rule.&amp;#160; The condition needs to tell the rule to “fail” when the URL starts with &lt;em&gt;exactly “&lt;/em&gt;SchoolBooks” (i.e. we don’t want to redirect if “SchoolBooks” was hit, either through the user typing the right URL or through our initial redirect&amp;quot;).&lt;/p&gt;  &lt;p&gt;In the “Conditions” section, hit the “Add…” button:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/5126.image_5F00_77459ACA.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/8030.image_5F00_thumb_5F00_3DC28AD3.png" width="643" height="201" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Enter the following in the “Add Condition” dialog and hit OK:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/0508.image_5F00_2F17DEEE.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/7851.image_5F00_thumb_5F00_0A86516A.png" width="503" height="333" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What this is saying is that the rule should &lt;strong&gt;only be enforced if &lt;/strong&gt;{R:1} (the first capture group in our regular expression, which will be the “schoolbooks” part of the URL) does not exactly match “SchoolBooks” (case &lt;u&gt;sensitive&lt;/u&gt; since “Ignore case” is &lt;strong&gt;unchecked&lt;/strong&gt;&amp;quot;).&lt;/p&gt;  &lt;p&gt;So again, the rule will run if the URL is “http://myserver/schoolbooks”, but will not if it is “http://myserver/SchoolBooks”&lt;/p&gt;  &lt;p&gt;Lastly, we need to specify what to do if the rule detects the wrongly cased URL.&lt;/p&gt;  &lt;p&gt;In the “Action” section, change the “Action type” to “Redirect” and enter the following in the “Redirect URL” field:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/8510.image_5F00_7BDBA584.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/6763.image_5F00_thumb_5F00_4258958D.png" width="582" height="283" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So this means that we’ll redirect to the URL that is “SchoolBooks” + whatever came after the “schoolbooks” part of the initial URL.&lt;/p&gt;  &lt;p&gt;If our URL was “http://myserver/schoolbooks/default.htm”&lt;/p&gt;  &lt;p&gt;{R:1} = “schoolbooks” &lt;/p&gt;  &lt;p&gt;{R:2} = “/default.htm” &lt;/p&gt;  &lt;p&gt;…so our final redirect URL will be “http://myserver/SchoolBooks/default.htm”&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now just hit the “Apply” button in the “Actions” pane and you’re done.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/4212.image_5F00_489F6C1B.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/5850.image_5F00_thumb_5F00_014A1629.png" width="384" height="304" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now I can see if the rule worked.&amp;#160; If I fire up Fiddler and try to hit http://myserver/schoolbooks/ &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/6443.image_5F00_46EEA047.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/2630.image_5F00_thumb_5F00_0AC2D49F.png" width="325" height="77" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I get this in the Response:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/4784.image_5F00_780DDAE7.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/2318.image_5F00_thumb_5F00_30B884F5.png" width="400" height="63" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And of course the next request has the right URL&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/8407.image_5F00_0507BAF9.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/5355.image_5F00_thumb_5F00_5DCD71C3.png" width="360" height="90" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And, if we created our “Condition” correctly, we don’t keep redirecting to this&amp;#160; URL until the browser gives up (this happened to me a couple times when making these rules because I kept forgetting the colon in {R:1} and {R:2}, turns out those are important).&lt;/p&gt;  &lt;p&gt;So that’s it, no more casing problem.&amp;#160; Hope this works for you.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The problem with casing ONLY applies to the application name.&amp;#160; The website name will automatically get lower-cased by the browser.&amp;#160; So if I type HTTP://MYSERVER/SCHOOLBOOKS in the address bar, the browser will automatically change that to http://myserver/SCHOOLBOOKS&lt;/p&gt;  &lt;p&gt;If you deploy your application to a website that is dedicated to this app (i.e. isn’t running other web apps) you can omit the “Application” part of the “Site/Application” field of the publish wizard and just supply the Site part.&amp;#160; The URL for your app will then be http://myserver (no app name, no problem).&lt;/p&gt;  &lt;p&gt;LightSwitch apps deployed as an Azure Cloud Service or to an Azure Web Site are deployed in the manner described above, so they don’t have the problem.&lt;/p&gt;  &lt;p&gt;If you don’t want to use the URL Rewrite Module and you are publishing to website with multiple applications, your best bet is probably to:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Enter a lowercase name for your Application as users would be more likely to type all lowercase when typing the URL&lt;/li&gt;    &lt;li&gt;Send users a shortcut to open the app and advise them to always use that to launch.&lt;/li&gt; &lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10388586" width="1" height="1"&gt;</content><author><name>Dave Kidder</name><uri>http://blogs.msdn.com/grandmasterchuckwagon_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="LightSwitch" scheme="http://blogs.msdn.com/b/david_kidder/archive/tags/LightSwitch/" /></entry><entry><title>Declaring LightSwitch Publish Wizard Bankruptcy</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/david_kidder/archive/2012/12/05/declaring-lightswitch-publish-wizard-bankruptcy.aspx" /><id>http://blogs.msdn.com/b/david_kidder/archive/2012/12/05/declaring-lightswitch-publish-wizard-bankruptcy.aspx</id><published>2012-12-06T02:05:45Z</published><updated>2012-12-06T02:05:45Z</updated><content type="html">&lt;p&gt;Sometimes if you attempt to publish the same LightSwitch project to different targets (e.g. first publishing to IIS then publishing to Azure) you can get some weird errors in the publish wizard.&amp;#160; If you have switched your publish targets or if you have manually updated/removed settings from your &lt;strong&gt;.lsproj&lt;/strong&gt; or &lt;strong&gt;.lsproj.user&lt;/strong&gt; file, you can do what I refer to as “declaring publish wizard bankruptcy” to start with a clean slate (i.e. the following will wipe out all previous state the publish wizard was keeping track of):&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Close Visual Studio&lt;/li&gt;    &lt;li&gt;Make a backup copy of your entire solution directory (I’d rather be safe than sorry)&lt;/li&gt;    &lt;li&gt;Delete your &lt;strong&gt;.lsproj.&lt;u&gt;user&lt;/u&gt; &lt;/strong&gt;file&lt;/li&gt;    &lt;li&gt;Open your &lt;strong&gt;.lsproj&lt;/strong&gt; file in a text editor and &lt;strong&gt;remove &lt;/strong&gt;any of the following settings you see in the first &amp;lt;PropertyGroup&amp;gt; section:&lt;/li&gt; &lt;/ol&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AdministratorFullName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AdministratorUserName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                          
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AllowUntrustedCertificate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                      
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DeployDatabase&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                                 
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AddAdministrator&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                               
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;BootstrapperComponentsUrl&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DefaultInstallLocation&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                         
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DeploySchema&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                                   
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PublishNewDatabase&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                             
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PublishUrl&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                                     
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PublishSite&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                                    
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RemotePublish&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                                  
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;UseLightSwitchWebDeploymentProvider&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;            
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureAllowUpgrade&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                              
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureAppendTimestampToDeploymentLabel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;          
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureDeploymentLabel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                           
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureWebSite&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureWebSpace&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureHostedService&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureHostedServiceLabel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                        
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureStorageService&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;SslCertificateThumbprint&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;LightSwitchPublishVersion&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                      
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PublishServiceOnly&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                             
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureCredentials&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RequireSecureConnection&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                        
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AllowAllWindowsUsers&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                           
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DefaultDatabaseName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;                            
&lt;/pre&gt;


&lt;blockquote&gt;
  &lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;5.&amp;#160; Save this file&lt;/p&gt;

&lt;p&gt;6.&amp;#160; Open your project in VS&lt;/p&gt;

&lt;p&gt;7.&amp;#160; Attempt to publish, re-specifying all your settings.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;So if you ever can’t get publish to work (after it has already worked) try these steps to see if it helps.&amp;#160; Otherwise, I will see you on the forums &lt;img style="style" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/6735.wlEmoticon_2D00_smile_5F00_5BAE2870.png" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a title="http://social.msdn.microsoft.com/Forums/en-US/category/vslightswitch" href="http://social.msdn.microsoft.com/Forums/en-US/category/vslightswitch"&gt;http://social.msdn.microsoft.com/Forums/en-US/category/vslightswitch&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10375066" width="1" height="1"&gt;</content><author><name>Dave Kidder</name><uri>http://blogs.msdn.com/grandmasterchuckwagon_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="LightSwitch" scheme="http://blogs.msdn.com/b/david_kidder/archive/tags/LightSwitch/" /></entry><entry><title>AX Window Management Tips</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/david_kidder/archive/2012/05/04/ax-window-management-tips.aspx" /><id>http://blogs.msdn.com/b/david_kidder/archive/2012/05/04/ax-window-management-tips.aspx</id><published>2012-05-04T03:50:30Z</published><updated>2012-05-04T03:50:30Z</updated><content type="html">&lt;p&gt;&lt;font size="4"&gt;It’s pretty easy to get tons of AOT windows open during AX development and sometimes windows will open in weird states (like &lt;em&gt;way way &lt;/em&gt;off to the right side of the workspace).&amp;#160; There are a few keyboard shortcuts related to window management that are essential to figuring out what’s going on with your windows.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Switching between AOT windows&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Most people are familiar with the ALT + TAB shortcut to switch between windows.&amp;#160; This doesn’t do any good for AX development windows, though, since they are contained within a parent workspace window.&amp;#160; A much lesser known shortcut to switching between these developer windows is &lt;strong&gt;CTRL + F6&lt;/strong&gt;.&amp;#160; This will cycle through your open development windows.&amp;#160; If you hit it one too many times and miss the one you wanted, you can cycle in the opposite order by doing &lt;strong&gt;CTRL + SHIFT + F6&lt;/strong&gt;.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Arranging your AOT windows when they get lost&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Sometimes AOT windows will size very weirdly or be positioned &lt;i&gt;way&lt;/i&gt; off to the right or bottom of the dev workspace. Other times a window will get positioned so that it’s title bar is above the area of the workspace so you can scroll to, so you won’t be able to move it.&amp;#160; To get out of these situations, you can use &lt;strong&gt;Windows Menu &amp;gt;&amp;gt; Cascade&lt;/strong&gt; to arrange all of your open AOT windows so you can see them all.&amp;#160; Then you can resize the one you were looking for. The keyboard shortcut for doing this is &lt;strong&gt;ALT + W, C &lt;/strong&gt;(that is, hit ALT + W to open the windows menu, then hit C to execute Cascade).&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Un-maximizing a window&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Other times you’ll have a maximized window that you don’t want maximized anymore (like if you need to open another AOT to drag+drop between).&amp;#160; &lt;strong&gt;CTRL + R&lt;/strong&gt;, the shortcut for Restore, is how you un-maximize your window so you can move it around.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font size="4"&gt;&lt;strong&gt;Declaring window bankruptcy&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Sometimes you just have an unmanageable number of windows open and should do what I call “declaring window bankruptcy” by doing &lt;strong&gt;Windows Menu &amp;gt;&amp;gt; Close All.&amp;#160; &lt;/strong&gt;The keyboard shortcut is &lt;strong&gt;ALT + W, A&lt;/strong&gt;.&amp;#160; This shortcut also works with application windows if you execute this from an AX 2012 Application Workspace.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Here’s where everything’s at in the Windows menu to recap.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/6646.image_5F00_4FC7E179.png"&gt;&lt;img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/4670.image_5F00_thumb_5F00_79C7DFA1.png" width="534" height="439" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Also notice the list of open windows that appear below the “Close All” item.&amp;#160; This will show you up to 9 open windows that you can easily switch between by typing the number next to the window name (e.g &lt;strong&gt;ALT + W, 2&lt;/strong&gt;)&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;That’s it for this post, hope these shortcuts come in handy.&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10300772" width="1" height="1"&gt;</content><author><name>Dave Kidder</name><uri>http://blogs.msdn.com/grandmasterchuckwagon_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>ReferenceTable &amp; Table References on EDT</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/david_kidder/archive/2012/03/05/referencetable-amp-table-references-on-edt.aspx" /><id>http://blogs.msdn.com/b/david_kidder/archive/2012/03/05/referencetable-amp-table-references-on-edt.aspx</id><published>2012-03-05T04:19:52Z</published><updated>2012-03-05T04:19:52Z</updated><content type="html">&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font size="4"&gt;&lt;em&gt;This post attempts to explain the behaviors of the ReferenceTable property and Table References node on Extended Data Types in Microsoft Dynamics AX 2012&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;font size="4"&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;Synopsis&lt;/strong&gt;:&amp;#160; Lookup &amp;amp; View Details behavior are controlled by Relations (either Table Relations or legacy EDT Relations) for controls &lt;strong&gt;bound &lt;/strong&gt;to table fields.&amp;#160; Controls that are &lt;strong&gt;not bound&lt;/strong&gt; to table fields, but have their ExtendedDataType property set, have their Lookup &amp;amp; View Details behavior controlled by the EDT settings ReferenceTable &amp;amp; Table References.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;I recently saw a bug come through regarding the Table References functionality on EDTs not working correctly.&amp;#160; Since I had no idea what the expected behavior was of this node (especially in relation to the ReferenceTable property) I started playing around with it some and contacted some developers on the appropriate team to find out what the expected behavior of these items was supposed to be.&amp;#160; Below is a summary of what I have found out.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Notes:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="3"&gt;Whenever creating an EDT which will set the ReferenceTable property, the core type of the EDT must match the type of the PrimaryKey on the ReferenceTable (i.e. Int64 for tables that use SurrogateKeys).&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="3"&gt;I will be using the terms &lt;strong&gt;bound &lt;/strong&gt;and &lt;strong&gt;unbound &lt;/strong&gt;controls in the following manner:&lt;/font&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;font size="3"&gt;&lt;strong&gt;Bound&lt;/strong&gt; control = a form control that is bound to a table field by having its DataSource &amp;amp; DataField (or ReferenceField) properties set.&lt;/font&gt;&lt;/li&gt;      &lt;li&gt;&lt;font size="3"&gt;&lt;strong&gt;Unbound &lt;/strong&gt;control = a form control that is not bound to a table field, but has its ExtendedDataType property set.&amp;#160; The most common use of unbound controls is in Dialogs.&lt;/font&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font size="4"&gt;Here we go…&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font size="4"&gt;If you &lt;strong&gt;&lt;em&gt;only set an EDT’s &lt;/em&gt;ReferenceTable property &lt;/strong&gt;here’s what you’ll get out of it:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;Unbound&lt;/strong&gt; controls that use this EDT will get Lookup and View Details behavior as long as the table you are pointing to uses SurrogateKey as its PrimaryKey.&amp;#160; So if you point to DirPartyTable, you’ll get these behaviors, but if you point to CustTable (which doesn’t use a SurrogateKey) you won’t (without one more step that we’ll get to in the next section).&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Another behavior you will get by setting the ReferenceTable property is when you drag this EDT onto the Fields list of a Table, you will be prompted with this dialog:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/7610.image_5F00_385AAEAE.png"&gt;&lt;img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/1665.image_5F00_thumb_5F00_4B9B654D.png" width="447" height="173" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="3"&gt;If you hit Yes to this dialog, a new PrimaryKey based ForeignKey relation will be created automatically.&amp;#160; Once you have this table relation, any controls that are &lt;strong&gt;bound &lt;/strong&gt;to this table field will have Lookup and View Details up and running to the table that was specified in the ReferenceTable property.&amp;#160; If you &lt;u&gt;do not &lt;/u&gt;add this relation, &lt;strong&gt;bound &lt;/strong&gt;controls will &lt;u&gt;not&lt;/u&gt; get Lookup/View Details behavior (also, when you drag this table field onto a form design, you won’t get a ReferenceGroup, you’ll get an Int64Control).&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="4"&gt;If you &lt;strong&gt;also&lt;em&gt; &lt;/em&gt;add a Table Reference &lt;/strong&gt;here’s what you’ll get out of it:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Actually there are a couple of different scenarios…&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;If you set the RelatedField property to the &lt;strong&gt;PrimaryKey&lt;/strong&gt; field of the ReferenceTable, you will get &lt;em&gt;exactly&lt;/em&gt; the same behavior as if you had only set the ReferenceTable property, with the exception that &lt;strong&gt;unbound&lt;/strong&gt; controls will get Lookup/View Details behavior regardless of the type of PrimaryKey they are using.&amp;#160; This discrepancy is probably a bug (which I will look into).&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/6114.image_5F00_1CD5ACAB.png"&gt;&lt;img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/2313.image_5F00_thumb_5F00_7C4E6CF8.png" width="359" height="91" /&gt;&lt;/a&gt;Example EDT for previous paragraph&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;If you set the RelatedField property to a field &lt;strong&gt;other than &lt;/strong&gt;the PrimaryKey, you will get Lookup/View Details behavior for &lt;strong&gt;unbound &lt;/strong&gt;controls, but you &lt;u&gt;will not&lt;/u&gt; be prompted to add a ForeignKey relation when you drag this EDT onto the Fields list of a Table.&amp;#160; If you don’t have a Relation defined using this table field you &lt;u&gt;will not&lt;/u&gt; get Lookup/View Details for controls &lt;strong&gt;bound &lt;/strong&gt;to this field.&amp;#160; Note that for the &lt;strong&gt;unbound &lt;/strong&gt;controls, the value returned from the lookup will be whatever field you set RelatedField to.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/3480.image_5F00_627A36C9.png"&gt;&lt;img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/0247.image_5F00_thumb_5F00_41F2F717.png" width="357" height="88" /&gt;&lt;/a&gt;Example EDT for previous paragraph&lt;/p&gt;    &lt;p&gt;&lt;font size="4"&gt;If you&lt;strong&gt; also add a Filter &lt;/strong&gt;here’s what you’ll get out of it:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;Once you have added a Table Reference, you can additionally add Filters.&amp;#160; Adding a filter to a Table Reference will restrict the rows that are displayed in the lookup.&amp;#160; Take a look at the CaseProcess EDT for an example of this:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/5047.image_5F00_7A316E2F.png"&gt;&lt;img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-51-46-metablogapi/4861.image_5F00_thumb_5F00_07978136.png" width="337" height="177" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;A lookup that uses this EDT (either an &lt;strong&gt;unbound &lt;/strong&gt;control or a control &lt;strong&gt;bound &lt;/strong&gt;to a table field that uses this EDT and has an appropriate relation) will restrict the records to those that satisfy the conditions that IsActive=1, IsTemplate=1 AND HierarchyType=5.&amp;#160; Filters on different table fields are AND’d together where as Filters on the same field are OR’d together.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;That’s all I got.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;Synopsis redux&lt;/strong&gt;: Lookup &amp;amp; View Details behavior are controlled by Relations (either Table Relations or legacy EDT Relations) for controls &lt;strong&gt;bound &lt;/strong&gt;to table fields. Controls that are &lt;strong&gt;not bound&lt;/strong&gt; to table fields, but have their ExtendedDataType property set, have their Lookup &amp;amp; View Details behavior controlled by the EDT settings ReferenceTable &amp;amp; Table References.&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10277493" width="1" height="1"&gt;</content><author><name>Dave Kidder</name><uri>http://blogs.msdn.com/grandmasterchuckwagon_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author></entry></feed>