Connected Show #36 – Steve Marx on Azure

Add Comment | Sep 03, 2010

image

In this episode, the one and only Windows Azure Tactical Strategist, Steve Marx, joins Dmitry and Peter to give us an update on the Windows Azure platform. Steve talks about common real world Windows Azure use patterns, including storage and compute instance configurations.

Steve uses some strategic tactics to tell us what’s in the tea leaves for the future of Azure. Peter also responds to “cat ladies & acne-laden teenagers” by sharing “The Memo”.

CLICK HERE TO LISTEN!

 

MarxBus3

WP7 “XamlParseException occurred” trying to run application

Add Comment | Aug 04, 2010

image

If you’re developing a Windows Phone 7 application you might run into this nasty error when trying to run your application:

System.Windows.Markup.XamlParseException occurred
  Message= [Line: 0 Position: 0]
  LineNumber=0
  LinePosition=0
  StackTrace:
       at MS.Internal.XcpImports.CheckHResult(UInt32 hr)…

The cause here isn't obvious from the exception, but actually its very simple once you know what to look for. In my case a basic cut-n-paste error caused bad binding code to get written:

Bad code

<Image Source="{Binding RelativeSource=ImageUri}" Grid.Column="0" />
<TextBlock Text="{Binding RelativeSource=Description}" Grid.Column="1" />

Correct code, error resolved!

<Image Source="{Binding Path=ImageUri}" Grid.Column="0" />
<TextBlock Text="{Binding Path=Description}" Grid.Column="1" />

(should have Path instead of RelativeSource, doh…)

So why so generic?

Windows Phone 7 is based on Silverlight 3 which from what I’ve been told has this as a known limitation, XAML error just don’t report great amounts of exact information.

Honestly its not something I noticed during my few projects around SL3 and now in SL4 there is better handling of reporting the exact issue.

What does this mean for WP7 developers?

This means that WP7 will have this issue for now. Hopefully WP7 will eventually move to Silverlight 4+ and we will see a better experience.

For now when you get this error simply try to look for some bad XAML that isn't breaking during Compile but will mess you up at runtime.

Detecting the Emulator in Windows Phone 7 SDK (WP7)

Add Comment | Jul 29, 2010

Today I had to write some code that would detect the Emulator we use to test WP7 Silverlight applications. For some reason though I had a really hard time finding the answer. Therefore I decided to post the solution here and to link the thread I finally did find which helped me find figure it out, which is this thread here.

Solution:

string DeviceTypeDetected = string.Empty;

switch (Microsoft.Devices.Environment.DeviceType)
{
    case Microsoft.Devices.DeviceType.Device:
        DeviceTypeDetected = "Real Device Detected!";
        break;
    case Microsoft.Devices.DeviceType.Emulator:
        DeviceTypeDetected = "Emulator Detected :(";
        break;
}

Connected Show #33 – Dmitry’s Soapbox

Add Comment | Jul 22, 2010

image

In this episode, guest host Andrew Brust is back again, joining Dmitry & I to talk about all of the tech news from Microsoft’s Wordwide Partner Conference in Washington, DC. The trio talks about WebMatrix, Internet Explorer 9 Preview 3, Windows Phone 7, and the newly announced Windows Azure Appliance.

A raging Dmitry also shares his poppin’ passion for HTML5.

CLICK HERE TO LISTEN!

Converting RowVersion (aka TimeStamp, aka binary(8)

Add Comment | Jul 21, 2010

Today I was working with RowVersions (aka TimeStamp, aka binary(8)) and tried to update a table with a value I had retrieved and stored by doing select @@DTBS

My stored notepad value was ‘0x0000000027A3CC07’ so I had run a query to update a table with it, but it didn’t work, the set value was different (‘0x3078303030303030’).

Being puzzled I tried a few queries and all of them returned this unexpected result which explained why my update set the wrong value, examples:

Queries

select CONVERT(rowversion, '0x0000000027A3CC07')
select CONVERT(timestamp, '0x0000000027A3CC07')
select CONVERT(binary(8), '0x0000000027A3CC07')

The above returned a result that did not match the RowVersion im passing in, causing me a lot of pain

Result:

image

Solution

I asked some of my MSFT colleagues and they pointed out the basic mistake I was making, remove the quotes! This value is not a string, it’s a hex.

Example of a good query:

select CONVERT(rowversion, 0x0000000027A3CC07)

This will return the same exact value as the one I passed in. As you can see, CONVERT (and cast) does not convert properly if you pass in a string for this datatype, instead remove the single quotes and you’re all set.

Bitlocker–Missing UI notification on encryption status & progress

Add Comment | Jul 14, 2010

Today I started Bitlocker (Windows 7 x64 bit OS) on an external drive but noticed something, the normal UI notification in the system tray that shows the progress indicator was missing. A bug? Perhaps.

When BitLocker starts it takes up the majority of the drive space to do the encryption, so to me it was clear the encryption was in progress but I couldn’t figure out how far along it was without the UI element.

Example: How I suspected encryption was still in progress (big red bar)

image[4]

To try and figure out what’s going on I reached out to my colleagues and was given a suggestion, “start the command prompt in administrator mode and run ‘manage-bde.exe –status’ command to see the status of encryption. Sure enough it provided me both the ‘conversion status’ and ‘percentage encrypted’ as shown below:

image

So if you’re ever stuck not being sure if Bitlocker is encrypting or how far along it is simply run the command above for the answer. Hope this helps someone!

Connected Show #32 – CoApp: Do EPIC Schtuff!

Add Comment | Jun 25, 2010

image
In this episode, guest Garrett Serack from the Microsoft Open Source Technology Center joins me to discuss CoApp, a new package manager for the Windows platform. Garrett tells us how CoApp will help make it easier for developers and users to build and install open source software on Windows.

(Interview starts at 34:15)

Also, Dmitry and I rap about Windows Phone 7, WCF, Outlook PST files, Visual Studio 2010 Power Tools, and IQueryable killing his cat.

CLICK HERE TO LISTEN!

Silverlight 4 – In-browser Vs. OOB + Elevated Trust

Add Comment | Jun 24, 2010

Today I put together some notes around what the main differences are between a Silverlight 4 application running in-browser Vs. out-of-browser (OOB) with elevated trust enabled (elevated trust is new in SL4). After compiling them i realized it would make a good reference blog post, so here it is:

SL 4 (in-browser)

SL 4 (OOB + Elevated trust)

Summary

Runs in a limited security and feature context, but provides the least requirements on the user in terms of:

· What security rights they have to install and promote applications (which is often an issue in the corporate world)

· Auto updating (no re-start required)

Runs out-of-Brower and in elevated trust environment providing for the most features and capabilities to interact with web services and local computer resources

(Elevated trust is separate from OOB and must be requested via options when configuring your application)

Feature: Web Browser

N/A

(Third party components do exist to render HTML in SL even when web browser isn’t available, example: HtmlHost from ComponentOne

Available

· Display any web-page

· Supports plug-ins like Flash (plays back video just fine for example!)

· Can display HTML string

Feature: COM Objects Interop

N/A

Available (OS dependent)

Example: Interop with Excel via COM to create spreadsheet data

Features: Auto-updates

Auto updates when the web page loads

You can implement code to auto update and it will be applied on next restart (at least I see no way to do it otherwise)

Feature: Full Screen

Requires user interaction

Can go into full screen without user interaction (example: using code to do so at startup)

   

Restrictions: Cross-Domain

Requires a clientaccesspolicy.xml or crossdomain.xml file

No restriction, access any URI

Restrictions: Access to local files

Via OpenFile / SaveFile Dialog control

No restriction on My Documents, My Pictures, My Music, et

Still cannot access any other folders on the computer

Some additional notes:

If anything above is incorrect please let me know folks, I’d love to improve my own knowledge. In the end which scenario you go after gets down the details and what the developers need to accomplish.

Metro UX concepts

Add Comment | Jun 11, 2010

 

One of my recent fascinations has been with the “Metro” UX concept from Microsoft. This is the user interface concept that is being developed for Windows Phone 7 and often is talked about when describing the idea behind Zune software UX.

In my quest to understand what Metro style applications should look like i’ve collected some good links, so here they are in case you’re also interested. (Have more examples? email me using the Contact link in this blog)

Metro User Interface Related Links:

Screenshots (from links above)

Metro Silverlight Theme

Grayscale Silverlight Theme

MetroTwit screenshot

music + video

Connected Show #31 – PHP On Windows

Add Comment | Jun 10, 2010

In this episode, guests Kanwaljeet Singla, Don Raman, and Wade Hilmo from the Microsoft IIS team join Peter to discuss the evolution of PHP on the Windows Platform. The IIS folks tell us about the improvements made to Windows in order to support PHP, including: Fast CGI, WinCache, PHP 5.3, the Web PI, and the SQL Server driver for PHP. (Interview starts at 24:31)

IISPHPTeam connectedGuest_31

Also, Dmitry and Peter rap about Windows Azure, Bing Maps, Expression Studio 4, & some “select developer” news about Windows Phone 7! All in Klingon to boot!

CLICK HERE TO LISTEN!