Archive for the ‘Uncategorized’ Category

I’m relatively new to Azure deployments, but the more I use them, the more I like the service. Unfortunately, it’s not WYSIWYG with deployments. What you see on IIS Express when development is not always what you’ll get after an Azure deployment. One issue I’ve come across is the MIME mappings aren’t the same, or don’t exist at all, and that’s preventing various file types, such as SVG images and WOFF2 fonts from being served. I also noticed that fixing Azure’s MIME mapping busted my AngularJS support in IIS Express – whoops!

Using the magic of web.config transforms, we can fix this for our release deployments. If you expand your web.config file, you’ll see web.Debug.config and web.Release.config. These files enable you to insert, replace, and remove settings based on your build configuration. Obviously, if you had multiple build configs, such as for different hosting environments, you’d insert those config names in addition web.*.config files.

To add SVG support, we need to insert our additional MIME types into the web.config. There’s no reason to do this in the master web.config, because it’s only necessary during release. This same tactic works very well for swapping the SMTP mail mailSettings section based on the hosting environment’s needs. For example, I swap localhost, where I use PaperCut to monitor sent email, to the actual settings upon deployment.

Below, you’ll see the fully modified web.Release.config from a recent deployment. This one worked perfectly for adding SVG and some missing font file extension support. You’ll notice I’m adding a new section under <system.webServer>. Note that I do not mark the webServer tag with an xdt:Transform. I don’t want to replace the entire section. I simply need to add the staticContent section to override some of the settings already configured in Azure. There are other options for xdt:Transform, such as Remove and Replace. This is a very powerful feature and I encourage you to learn more about it from Microsoft.

    <staticContent xdt:Transform="Insert">

I hope this helps!

Snippet

<?xml version="1.0"?>
 
<!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=301874 -->
 
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.webServer>
    <!-- Add support for video files and other non-standard file request types. This breaks AngularJS support in IISExpress, hence why it's here instead. -->
    <staticContent xdt:Transform="Insert">
      <!-- if you don't remove certain extensions first, the site won't load, whoops! -->
      <remove fileExtension=".svg" />
      <remove fileExtension=".svgz" />
      <remove fileExtension=".eot" />
      <remove fileExtension=".ttf" />
      <remove fileExtension=".woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
      <mimeMap fileExtension=".ogv" mimeType="video/ogg" />
      <mimeMap fileExtension=".webm" mimeType="video/webm" />
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml"/>
      <mimeMap fileExtension=".svgz" mimeType="image/svg+xml"/>
      <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
      <mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
      <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
    </staticContent>
  </system.webServer>
 
</configuration>

I ran into this issue a few weeks ago… The option for “Connect to a wireless display” was no longer available on my Surface Pro 3. It disappeared on my Acer S7 laptop, too. What the heck is going on?!?! Well, I figured it out with some sleuthing on the interwebs… Oracle’s VirtualBox, for whatever reason unbeknownst to me, disables support for WiDi and Miracast in Windows 8. Uninstalling VirtualBox solved the problem. I also read some VPN clients cause this issue to occur, but that didn’t appear to be my case.

I’ve logged a bug with Oracle – this is a usability bug and should be fixed. I’d love an explanation as to why it’s disabled.

Here’s the bug: https://www.virtualbox.org/ticket/13998

I hope that helps anyone having a similar issue!

Best,

-Auri

10 Secrets You Should Have Learned with Your Software Engineering Degree – But Probably Didn’t

I had the unique opportunity to try the prototypes of the abovementioned personal transporters. The Winglet is similar to the Segway, yet smaller, made with much more plastic, and with a slightly different steering system. The Uni-cub is targeted towards indoor transport, such as for the elderly, and you move by shifting your weight, similar to the Segway again, but in the sitting position. Enjoy the videos.

Riding the Toyota Winglet

I struggled with this for about a day, and there were a lot of sites saying I should just use button.ID or button.UniqueID to set the default button for a panel. Nope, that wasn’t working. Some users were complaining the issue was only occurring on setting default button when in a control contained in a Master page.

The error would be:

The DefaultButton of panel  or page must be the ID of a control of type IButtonControl.

So, here’s what you do to fix it:

// Set the default buttons.

((Panel)Page.FindControl(nameofthepanel.UniqueID)).DefaultButton = nameofthebutton.ID;


I hope that helps Smile

Best,

-Auri

Lois turned a year older while in Israel. Birthday Cakes sure are hard to find, but Tito came through!

Lois’ birthday in Israel!

Took this video while at an Oasis in southern Israel near the Ramon Crater.

Climbing and Exploring the Oasis

Israel 2011 – Day 5

Posted: June 3, 2011 in Uncategorized

Photos from Israel

Posted: June 2, 2011 in Uncategorized

Enjoy – took these over the past few days. You can download the Windows 7 Theme here.

Feel free to share the theme or the photos, as long as you give me credit. You may not sell them or use them for profit in any way.