Nick's .NET Travels

Continually looking for the yellow brick road so I can catch me a wizard....

Windows Phone 8.1 Developer Power Tools

Last week at BUILD, Microsoft announced the availability of Visual Studio 2013 Update 2 RC, which includes the new Windows Phone 8.1 SDK.

I’m sure there will be a lot of blog posts talking about the new Universal project, the additional capabilities introduced in Windows Phone 8.1, Windows Phone XAML applications, the new application lifecycle model etc. I want to take a different approach and talk about some of the additional tools that come with the SDK.

One of the benefits Windows Phone development aligning with Windows app development is that more of the experiences along the development lifecycle will be similar. For example from the Project menu, Windows Phone developers now have the Store sub-menu with the ability to Create App Package.

image

One of the other additions is under the Tools menu, where there is a Windows Phone 8.1 sub-menu. This includes the Developer Power Tools, Developer Unlock and the Application Development tools. Whilst the last two are not new to Windows Phone development, they can now be reached from within Visual Studio.

image

The Developer Power Tools, not to be confused with the Windows Phone Power Tools, is a standalone tool which can be used to inspect what’s going on across either emulator or device. Help is available via MSDN

image

One of the most interesting thing about these tools is that you can start them, disconnect your device, put your application through its paces in real world scenarios, then reconnect and review the data at a later stage. For example, using the Performance Recorder you can check the data you want to record (eg CPU and Power) and hit Start. You can then disconnect the device, or in this case the emulator, open and run your application, and then reconnect and Stop the recording. This will prompt you to save a .etl file which includes all the data recorded.

image

The .etl file can then be opened using Windows Performance Analyzer (just double-click the file in Windows Explorer).

image

Hopefully these tools will help you track down issue in performance and usage of your application

Pingbacks and trackbacks (3)+

Comments are closed
Perpetual Expression Blend Crashes

Nick's .NET Travels

Continually looking for the yellow brick road so I can catch me a wizard....

Perpetual Expression Blend Crashes

As part of building Windows Phone applications I’m forever flipping between Visual Studio and Expression Blend. Sometimes I encounter issues with Blend that it just can’t deal with and will simply self combust, giving me a text file crash stack. The most common cause is where I’ve accidentally crossed threads, resulting in the following:

System.UnauthorizedAccessException: Invalid cross-thread access.
   at MS.Internal.XcpImports.CheckThread()
   at MS.Internal.XcpImports.CreateObjectByTypeIndex(UInt32 typeIndex)
   at System.Windows.Threading.DispatcherTimer..ctor(UInt32 nativeTypeIndex)
   at System.Windows.Threading.DispatcherTimer..ctor()

Unfortunately the resolution isn’t that simple – I can fix the code ok, but the issue is that Blend won’t load the project again without crashing. This is because Blend uses a compiled version of the application to display the design surface. On startup it attempts to use the version that has already been built (in this case it includes the faulty code that causes the exception) so it crashes again. Unlike Visual Studio that handles this gracefully, there is no capability within Blend to for example open the project without any files open….

The solution: Delete the bin/obj folders from your application and open in Blend (of course after fixing the code issue). Blend will then be forced to do a new build of the application that should no longer raise the exception.

Pingbacks and trackbacks (2)+

Comments are closed