Wednesday, March 23, 2011

Attaching an External DataSource in LightSwitch Application

Attaching an External DataSource in LightSwitch Application


Attaching an External DataSource in LightSwitch Application

Posted: 23 Mar 2011 03:26 AM PDT

You might know that, LightSwitch is now in Beta 2 stage. Microsoft released it few days ago. I have a series of Tutorial on LightSwitch Beta 1 where we discussed on creating database tables using the LightSwitch table designer.   In this tutorial...( read more )...(read more)

Interview with SilverlightShow Eco Contest First Runner-up Peter Kuhn

Posted: 22 Mar 2011 06:03 PM PDT

Q. Hi Peter. Congratulations on becoming the first runner-up in our Eco Contest, with your application ' Do you twig? '! Our community already knows you as one of SilverlightShow article authors – you are currently running quite a popular...( read more )...(read more)

Silverlight Cream for March 22, 2011 -- #1063

Posted: 22 Mar 2011 10:44 PM PDT

In this Issue: Colin Eberhardt , XamlNinja , Andrea Boschin , Michael Washington , Michael Crump , Alex Knight , WindowsPhoneGeek , Jesse Liberty ( -2- ), Damon Payne . Above the Fold: Silverlight: "7Metro: Silverlight Theme" Alex Knight WP7: "Metro In...( read more )...(read more)

Tuesday, March 22, 2011

A Smarter TextBlock Control for WP7

A Smarter TextBlock Control for WP7


A Smarter TextBlock Control for WP7

Posted: 22 Mar 2011 01:36 PM PDT

One of the nice themes of Windows Phone 7 is that of making the everyday simpler and smarter. To that end, in the original Phone 7 OS there is no copy-and-paste, with the idea that anywhere you have a phone number, you should be able to dial by pressing...( read more )...(read more)

Exception Boundaries: Working With Multiple Error Handling Mechanisms

Posted: 22 Mar 2011 09:00 AM PDT

David Blaikie

Greetings! I'm David Blaikie, Software Design Engineer at Microsoft and guest blogger here on VCBlog. I work in the Windows product group, writing test infrastructure tools in C++. One of the luxuries of the codebases I work in is that they are relatively modern and flexible. We use the full gamut of C++0x features implemented in Visual Studio 2010 including lambdas and rvalue references/move construction where possible. At a more fundamental level, we also choose to use exceptions.

Though I won't get into a debate on the pros and cons of different error handling techniques in this post, it suffices to say that we use exceptions but both our dependencies in some cases (WinAPIs, etc) and some of our users (we have API level exposure to Windows test code sources) don't expose exceptional APIs or build their code with exceptions enabled. To that end, we, like many other developers, need to live our exceptional lives within a possibly unexceptional world. Perhaps you've encountered similar situations and thought that because the rest of your code base (or your dependencies/consumers) weren't using exceptions that your own code was just going to have to inherit that design choice.

In fact, there are a variety of simple techniques, reusable code snippets and small library classes you can write to happily insulate your exceptional code from unexceptional consumers and dependencies.

 

Unexceptional Dependencies

Dealing with dependencies (API functions, classes) that do not use exceptions is fairly simple. Let's first take an example of some simple unexceptional code and see how it might be transformed:

  1. BOOL DiffHandles(HANDLE file1, HANDLE file2);
  2. BOOL DiffFiles(const wchar_t* file1, const wchar_t* file2)
  3. {
  4.     HANDLE file1Handle = CreateFile(file1, GENERIC_READ, ?);
  5.     BOOL result = FALSE;
  6.  
  7.     if (fileHandle != INVALID_HANDLE_VALUE)
  8.     {
  9.         HANDLE file2Handle = CreateFile(file2, GENERIC_READ, ...);
  10.         if (file1Handle != INVALID_HANDLE_VALUE)
  11.         {
  12.             result = DiffHandles(file1Handle, file2Handle);
  13.             CloseHandle(file2Handle);
  14.         }
  15.         CloseHandle(file1Handle);
  16.     }
  17.     return result;
  18. }

First things first: Don't use this function. It's good as a demonstration, but as real code it has a bunch of things wrong with it (not to mention it's incomplete anyway).

While this code doesn't seem to have a lot of error handling problems, that's only because the error message handling is done off to the side. CreateFile, for example, specifies that if it returns INVALID_HANDLE_VALUE it will provide additional error information through GetLastError and we could imagine that DiffHandles would have to do the same thing, seeing similar failures from reading from the file (if a network share went away, for example) and would heap those all under a FALSE return value. Users of DiffFiles would have to ensure they check GetLastError any time that FALSE is returned to them. Not only would it be easy for them to forget and just assume the files were different, rather than that the comparison itself failed (perhaps it's a transient network issue – the file comparison failed and then the network connection came up again and the files happen to have matching contents. This could cause problems) but also the failures the user of this API receives are vague and any messages shown to the user would be hard for the user to understand or address. While the error value from the function might say that a file was [not found, unable to be read because of permissions, or any other reason] it might not say /which/ of the two files had the problem.

So our first step might be to ensure actual failures produce exceptions while the test (are the file contents different) returns false. This will distinguish between the legitimate cases and runtime failures that occurred while attempting to execute the function. In this case our function's type remains the same (though I'll switch to "bool" now that we don't have a Win32 legacy to interact so directly with) though the contract is different: Return true if the files match, false if the files differ, throw an exception if we couldn't determine whether the files match or not.

We'll introduce a simple helper function to that end:

  1. void ThrowLastErrorIf(bool expression, const wchar_t* message)
  2. {
  3.     if (!expression)
  4.     {
  5.         throw Win32Exception(GetLastError(), message);
  6.     }
  7. }

This isn't the most advanced form of such a function. We could do much more to create more informative/human readable error messages. Perhaps Win32Exception type could use FormatMessage to produce a human readable message from the error code and append our message string on to that in some manner. In any case, our function can now be rewritten as follows:

  1. bool DiffFiles(const wchar_t* file1, const wchar_t* file2)
  2. {
  3.     HANDLE file1Handle = CreateFile(file1, GENERIC_READ, ?);
  4.     ThrowLastErrorIf(file1Handle != INVALID_HANDLE_VALUE, file1);
  5.     HANDLE file2Handle = CreateFile(file2, GENERIC_READ, ...);
  6.     ThrowLastErrorIf(file2Handle != INVALID_HANDLE_VALUE, file2);
  7.     BOOL result = DiffHandles(file1Handle, file2Handle);
  8.     ThrowLastErrorIf(result == FALSE && (GetLastError() != MY_APPLICATION_ERROR_FILE_MISMATCH), L"Could not compare file contents");
  9.     CloseHandle(file1Handle);
  10.     CloseHandle(file2Handle);
  11.     return result;
  12. }

But wait, I (hope I) hear you cry, wouldn't this leak file handles if we throw exceptions? Right you are. While I could've written this modified version to handle that leak it would've been somewhat convoluted so instead I'm going to demonstrate a better way.

By wrapping up these HANDLEs in a type that can handle their destruction in a more C++, RAII manner we can not only make this code more readable but also correct (non-leaking)

  1. class File
  2.     {
  3. private:
  4.     HANDLE handle;
  5.  
  6.     //declared but not defined to avoid double closing
  7.     File& operator=(const File&);
  8.     File(File&);
  9. public:
  10.     File(const wchar_t* file)
  11.     {
  12.         handle = CreateFile(file, GENERIC_READ, ...);
  13.         ThrowLastErrorIf(handle, file);
  14.     }
  15.  
  16.     HANDLE Get()
  17.     {
  18.         return handle;
  19.     }
  20.  
  21.     ~File()
  22.     {
  23.         CloseHandle(handle);
  24.     }
  25. };

And rewriting the original function again, we get:

  1. bool DiffFiles(const wchar_t* file1, const wchar_t* file2)
  2. {
  3.     File f1(file1);
  4.     File f2(file2);
  5.     result = DiffHandles(f1.Get(), f2.Get());
  6.     ThrowLastErrorIf(result == FALSE && (GetLastError() != MY_APPLICATION_ERROR_FILE_MISMATCH), L"Could not compare file contents");
  7.     return result;
  8. }

All without leaks and the need to pay close attention to code paths to ensure resource destruction.

It's not quite the same as it would be if DiffHandles was an exception-aware API, but it tidies up the function a bit and means that unexceptional dependencies don't pollute our exception-aware codebase.

The implementation of the Win32Exception type and enhancements to the ThrowLastErrorIf function (to include mapping specific result values to already well known exception types such as std::bad_alloc) is left as an exercise for the reader.

 

Unexceptional Consumers

Types of Unexceptional Consumers

We've seen that Win32 "invalid return (FALSE, INVALID_HANDLE_VALUE, etc) + GetLastError" is one kind of unexceptional error message scheme. Other APIs you might run into that have an unexceptional boundary include C code (indeed Win32's API is a specific case of this, but POSIX uses int return values and errno to similar effect) or HRESULT returning COM APIs.

[While it might not be immediately obvious why it's worth considering C code as an unexceptional consumer ("my users will be writing in C, so my library must be in C" I hear you cry) it's actually quite possible to write a C API in C++. By declaring your functions with extern "C" you can have C linkage functions in a C++ compilation unit using the full functionality of the C++ programming language in your implementation]

 

Dealing with Unexceptional Consumers

Dealing with unexceptional consumers is perhaps a little trickier, though the most basic implementation is not terribly difficult, if a little verbose and lossy. Let's invert the above example. Imagine we had the original DiffFiles, but we wanted to keep the interface (BOOL do_things + GetLastError) but we had updated our dependencies (File handling using RAII resource wrappers as shown, as well as updating DiffHandles, or using the STL) to be exception-aware themselves. As such they no longer return failures through GetLastError, instead returning bool and throwing exceptions for their failures. Perhaps not even Win32Exception failures (this particular exception type wouldn't be used pervasively, but only when interacting with unexceptional APIs where no more accurate exception type was available to represent the failure).  We could simply rewrite the DiffFiles function as follows:

  1. BOOL DiffFiles(const wchar_t* file1, const wchar_t* file2)
  2. {
  3.     try
  4.     {
  5.         File f1(file1);
  6.         File f2(file2);
  7.         if (!DiffHandles(f1, f2))
  8.         {
  9.             SetLastError(MY_APPLICATION_ERROR_FILE_MISMATCH);
  10.             return FALSE;
  11.         }
  12.         return TRUE;
  13.     }
  14.     catch(const Win32Exception& e)
  15.     {
  16.         SetLastError(e.GetErrorCode());
  17.     }
  18.     catch(const std::exception& e)
  19.     {
  20.         SetLastError(MY_APPLICATION_GENERAL_ERROR);
  21.     }
  22.     return FALSE;
  23. }

You should be sure to catch any/all exceptions which could be produced by the code in the try block. In this case we know that the File class and DiffHandles function can only throw Win32Exceptions so we can just handle that.

With this basic implementation we lose all exception detail, even those details we could map to interesting results (perhaps std::bad_alloc could be mapped to an out of memory Win32 error code for example), so it's not ideal. Again, we could imagine putting a variety of catch blocks in to map different exception types to various failures, adding logging to record the full details of the exception (since we'll be compressing entire exception objects including strings of context, stack traces, etc, into a single win32 error code) before it is coalesced into a single value for return, etc. In doing so every one of the functions on our unexceptional public interface is going to get long and unwieldy.

 

Macros as an Exception Consuming Boundary

To reduce the syntactic overhead in this case we can use macros to implement a convenient wrapper to hide all that possible complexity and repeated logic:

  1. #define WIN32_START try {
  2. #define WIN32_END } catch (const Win32Exception& e) { SetLastError(e.GetErrorCode()); } catch (const std::exception& e) { SetLastError(MY_APPLICATION_GENERAL_ERROR); } return FALSE;

The do_things function then becomes:

  1. BOOL DiffFiles(const wchar_t* file1, const wchar_t* file2)
  2. {
  3.     WIN32_START
  4.         File f1(file1);
  5.         File f2(file2);
  6.         if (!DiffHandles(f1, f2))
  7.         {
  8.             SetLastError(MY_APPLICATION_ERROR_FILE_MISMATCH);
  9.             return FALSE;
  10.         }
  11.         return TRUE;
  12.     WIN32_END
  13. }

While macros provide an obvious way to implement this functionality they can make code hard to debug and analyze.

 

Lambdas as an Exception Consuming Boundary

We can tidy this up a little further, replacing macros with lambdas as follows:

  1. template<typename Func>
  2. BOOL Win32ExceptionBoundary(Func&& f)
  3. {
  4.     try
  5.     {
  6.         return f();
  7.     }
  8.     catch(const Win32Exception& e)
  9.     {
  10.         SetLastError(e.GetErrorCode());
  11.     }
  12.     catch(const std::exception& e)
  13.     {
  14.         SetLastError(MY_APPLICATION_GENERAL_ERROR);
  15.     }
  16.     return FALSE;
  17. }

With this function, we can now reduce our do_things() function to:

  1. BOOL DiffFiles(const wchar_t* file1, const wchar_t* file2)
  2. {
  3.     return Win32ExceptionBoundary([&]()
  4.     {
  5.         File f1(file1);
  6.         File f2(file2);
  7.         if (!DiffHandles(f1, f2))
  8.         {
  9.             SetLastError(MY_APPLICATION_ERROR_FILE_MISMATCH);
  10.             return FALSE;
  11.         }
  12.         return TRUE;
  13.     });
  14. }

The Win32ExceptionBoundary could be generalized (so it could be used with, say, HANDLE returning functions) by taking the error result as an extra parameter and using that to infer the return type of the template function, for example.

 

Summary

With tools such as these you can introduce exception-aware code into your code base, enabling you to take advantage of the myriad of carefully implemented and tested standard libraries such as containers, smart pointers, and algorithms without having to revamp your entire codebase. Your exception-aware walled garden can grow as time and business justification permits, converting single functions/libraries at a time.

SilverlightShow for March 14-20, 2011

Posted: 22 Mar 2011 06:53 AM PDT

Check out the Top Five most popular news at SilverlightShow for March 14-20, 2011. Here are the top 5 news on SilverlightShow for last week: Microsoft's Response to the "Why I'm Close to Giving Up on WP7" blog post Windows Phone 7 Icon Set : metro second...( read more )...(read more)

MEFing up John Papa’s MVVM code from Firestarter

Posted: 21 Mar 2011 09:58 PM PDT

Back on December 2, 2010 John Papa gifted the community with an excellent example of proper Silverlight architecture and I have been recommending people watch the video, download John's code, and follow the pattern to create their own applications Read More......(read more)

Jeremy Likness on Unit Testing XAML Data-Bindings in Silverlight

Posted: 21 Mar 2011 04:22 PM PDT

Are you a developer who wonders "How do we test the XAML?" Have you ever handed off XAML to a designer or another developer, who has accidentally removed a data-binding or other critical element, and then handed it back? In this week's guest blog, Silverlight...( read more )...(read more)

NuGet Package of the Week #3 - PhoneyTools for Windows Phone 7

Posted: 21 Mar 2011 12:17 PM PDT

Have you implemented the NuGet Action Plan ? Get on it, it'll take only 5 minutes: NuGet Action Plan - Upgrade to 1.1, Setup Automatic Updates, Get NuGet Package Explorer . The Backstory: I was thinking since the NuGet .NET package management site is Read More......(read more)

Monday, March 21, 2011

The Visual C++ Weekly Vol. 1 Issue 11 (Mar 12, 2011)

The Visual C++ Weekly Vol. 1 Issue 11 (Mar 12, 2011)


The Visual C++ Weekly Vol. 1 Issue 11 (Mar 12, 2011)

Posted: 12 Mar 2011 09:00 AM PST

[Delayed posting, just for the records]

Read in this issue:

  • [MS Parallel Programming] Sorting in PPL
  • [Visual C++ team] Visual Studio 2010 Service Pack 1 General Availability
  • [John Socha-Leialoha] C++/CLI to C++ Tips and Tricks
  • [Thomas Becker] C++ Rvalue References Explained
  • [Stephan L. Lavavej] Algorithm Optimizations - Advanced STL, Part 2

RC of Entity Framework 4.1 (which includes EF Code First)

Posted: 19 Mar 2011 11:32 PM PDT

Last week the data team shipped the Release Candidate of Entity Framework 4.1.  You can learn more about it and download it here . EF 4.1 includes the new "EF Code First" option that I've blogged about several times in the past.  EF Code First provides a really elegant and clean way to work with data, and enables you to do so without requiring a designer or XML mapping file.  Below are links to some tutorials I've written in the past about it: Code First Development with Entity Framework 4.x EF Code First: Custom Database Schema Mapping Using EF Code First with an Existing Database The above tutorials were written against the CTP4 release of EF Code First (and so some APIs might be a little different) – but the concepts and scenarios...(read more)

NuGet Package of the Week #3 - PhoneyTools for Windows Phone 7

Posted: 21 Mar 2011 12:17 PM PDT

Have you implemented the NuGet Action Plan ? Get on it, it'll take only 5 minutes: NuGet Action Plan - Upgrade to 1.1, Setup Automatic Updates, Get NuGet Package Explorer . The Backstory: I was thinking since the NuGet .NET package management site is...( read more )...(read more)

Windows Client Developer roundup 064 for 3/21/2011

Posted: 21 Mar 2011 11:58 AM PDT

This is Windows Client Developer Roundup #64. The Windows Client Developer Roundup aggregates information of interest to Windows Client Developers, including WPF , Silverlight , Visual C++ , XNA , Expression Blend , Surface , Windows 7 , Windows Phone...( read more )...(read more)

Windows Client Developer roundup 064 for 3/21/2011

Posted: 21 Mar 2011 11:58 AM PDT

This is Windows Client Developer Roundup #64. The Windows Client Developer Roundup aggregates information of interest to Windows Client Developers, including WPF , Silverlight , Visual C++ , XNA , Expression Blend , Surface , Windows 7 , Windows Phone...( read more )...(read more)

SQL Azure Migration Wizard v3.5.9

Posted: 31 Aug 2009 02:23 PM PDT

SQL Azure Migration Wizard (SQLAzureMW) is designed to help you migrate your SQL Server 2005/2008 databases to SQL Azure. SQLAzureMW will analyze your source database for compatibility issues and allow you to fully or partially migrate your database schema and data to SQL Azure.

WP7Contrib – Page Transitions and Navigation Service

Posted: 21 Mar 2011 08:33 AM PDT

I finally got around to updating the page transistions in wp7 contrib last week, its something that has been on my list for awhile. For a complete sample project check out the sample in the spikes folder where you can also find lots of other samples illustrating...( read more )...(read more)

Interview with SilverlightShow Eco Contest Grand Prize Winner Jeyanandan Nandakumar

Posted: 20 Mar 2011 08:15 PM PDT

Q. Hi Jey. Congratulations on winning the Grand Prize in our Eco Contest, with your application ' The Lost Leaf '! Please introduce yourself to the community at SilverlightShow – your country, job, experience with Silverlight, anything...( read more )...(read more)

Windows Phone 7 - Part #8: Using Sensors

Posted: 20 Mar 2011 07:21 PM PDT

This article is compatible with the latest version of Silverlight for Windows Phone 7. Don't miss... WP7 shows WP7 Stock Quoting Demo series What is Windows Phone series WP7 Developer Guide: Show more books This is part is the final, 8th part from the...( read more )...(read more)

3D on Windows Phone 7 using Balder

Posted: 20 Mar 2011 11:39 PM PDT

This is not my first time to talk on 3D on Silverlight or Phone platform,In past I wrote decent amount of stuff including Kit3D,3D in Silverlight and recently I wrote 3D on Windows Phone 7 using capabilities of Silverlight framework sitting inside phone...( read more )...(read more)

Silverlight Cream for March 20, 2011 -- #1062

Posted: 20 Mar 2011 10:37 PM PDT

In this Issue: Ollie Riches , Damon Payne ( -2- ), Jesse Liberty ( -2- ), Shawn Wildermuth , John Papa , Beth Massi , Michael Crump , Mike Taulty ( -2- ), Jorge Peraza , and Peter Kuhn ( -2- ). Above the Fold: Silverlight: "Delay Binding Updates within...( read more )...(read more)

Windows Phone, a great dev platform: adding leaderboards to 4th & Mayor in 30 minutes

Posted: 20 Mar 2011 08:07 PM PDT

Just over a week ago, a new foursquare feature was released for nice leaderboards. WP7 is fast - I added the feature in about 30 minutes....( read more )...(read more)

4th & Mayor: the ultimate foursquare app for your Windows Phone

Posted: 20 Mar 2011 03:43 PM PDT

I'm pleased to announce that my foursquare app for Windows Phone, 4th & Mayor, is now available on the Windows Phone Marketplace....( read more )...(read more)

Sunday, March 20, 2011

Building MVVM Light from Codeplex

Building MVVM Light from Codeplex


Building MVVM Light from Codeplex

Posted: 20 Mar 2011 12:40 PM PDT

I just published an article describing how to get the source code from Codeplex, build it, unit test it, get all the DLLs and install them to replace a previously installed version. It's not very complicated, but it is good to have this information in...( read more )...(read more)

MVVM Light V4 preview 2 (BL0015) #mvvmlight

Posted: 20 Mar 2011 08:36 AM PDT

Over the past few weeks, I have worked hard on a few new features for MVVM Light V4. Here is a second early preview (consider this pre-alpha if you wish). The features are unit-tested, but I am now looking for feedback and there might be bugs! Bug correction...( read more )...(read more)

Silverlight Training Montreal in April 2011

Posted: 19 Mar 2011 04:11 PM PDT

The Silverlight Tour deliver one more class in Montreal , come and learn top Silverlight content from local experts!!! >> This course will be taught in French * << What: Silverlight training When: April 25-28 (4 days) Where: Montreal, Qc Registration...( read more )...(read more)

The Visual C++ Weekly Vol. 1 Issue 12 (Mar 19, 2011)

Posted: 19 Mar 2011 02:41 PM PDT

Read in this issue:

  • [Patterns and Practices] Parallel Programming with MS Visual C++ (online guidance)
  • [CodeProject] 3-D Software Rendering Engine – Part I
  • [Viva64] Lessons on Development of 64-bit Applications
  • [Vlad Lazarenko] C++ Exception Handling and Performance
  • [Channel 9] Kate Gregory on Being a Most Valuable Professional (MVP)
  • [Intel] Free Speedup with Compiler Switches for Fast Math and Intel® Streaming SIMD Extensions 
  • [Visual C++ team] Proposed Workaround for Assembly Signing Issue with VS2010 SP1
  • [Nishant  Sivakumar] C++/CLI equivalent for C#'s default(T)
  • [C++ and Beyond] Registration for C&B 2011 is now open

Saturday, March 19, 2011

MVP Summit 2011

MVP Summit 2011


MVP Summit 2011

Posted: 19 Mar 2011 06:18 AM PDT

Here is the traditional Canadian " Sea Of Red " picture at the MVP Summit ! picture by Morten Rand-Hendriksen   And a special one, this is the Silverlight MVPs group: picture by Corey Schuman...( read more )...(read more)

Silverlight & WCF RIA Services: strategies for handling your Domain Context - Part 2

Posted: 18 Mar 2011 11:22 PM PDT

Don't miss... Deep Dive Into WCF series WCF article series by B.Noyes WCF RIA Services Shows SL4 Business App Development book: Show more books This is the second in a two-part article series on the WCF RIA Services Domain Context. Part 1: Introduction...( read more )...(read more)

Announcing Visual Studio LightSwitch Beta 2 is available

Posted: 18 Mar 2011 05:58 PM PDT

We are proud to announce that Visual Studio LightSwitch Beta 2 is now available for download. LightSwitch gives you a simpler and faster way to create high-quality Silverlight business applications for the desktop and the cloud. If you are new to Visual...( read more )...(read more)

Extending LightSwitch Beta 2 Applications

Posted: 18 Mar 2011 05:49 PM PDT

Hello Silverlight Community, I am the product manager for Microsoft® Visual Studio® LightSwitch™. Today, we are making Visual Studio LightSwitch Beta 2 publicly available for download. If you are new to Visual Studio LightSwitch Beta 2 here...( read more )...(read more)

How to: Configure Visual C++ Projects to Target 64-Bit Platforms (Visual C++ 2010)

Posted: 18 Mar 2011 05:25 PM PDT

This topic describes how to set up C++ applications to target 64-bit platforms using project configurations available in the Visual Studio IDE.

Friday, March 18, 2011

Tutorial: Building a connected phone app with AgFx

Tutorial: Building a connected phone app with AgFx


Tutorial: Building a connected phone app with AgFx

Posted: 17 Mar 2011 02:39 PM PDT

Earlier this week I wrote a post detailing the application framework that I've been working on, which I'm calling AgFx. I wanted that post to be a bit of an introductory overview,. Now I'm going to dig into detail a bit more, as well as show a bit about how you can use the free Windows Phone 7 Developer tools to quickly create a great application. AgFx does a lot, and one of the apps I used to generate requirements and testing, is Jeff Wilcox's gorgeous new foursquare™ client: 4th & Mayor , which is built on AgFx. Jeff and I, along with some others, have written several apps on top of AgFx over the last few months, and have really sharpened it to be exactly what you need when building a connected phone application...(read more)

Enabling IIS Express support in VS 2010 Sp1

Posted: 14 Mar 2011 09:40 PM PDT

With the Sp1 release of Visual Studio 2010 now available for download , you now have the option to use IIS Express as the development server for your web projects instead of the built-in Visual Studio Development server (aka. Cassini). Here are some previous blog posts explaining the IIS Express integration features in VS 2010 Sp1 Beta, which are also available with this new release of Sp1: VS 2010 SP1 (Beta) and IIS Express Visual Studio 2010 SP1 Beta IIS Express Integration VS 2010 SP1 and IIS Express should both be installed to enable IIS Express support To enable using IIS Express as the development server for your web projects, you need to have both the Sp1 release of VS 2010 as well as the IIS Express web server installed. See the 'Installing...(read more)

Silverlight TV 66: Phoney - New Windows Phone 7 Open Source Project

Posted: 18 Mar 2011 08:34 AM PDT

If you have trouble using bit.ly or logging on Windows Phone 7, check out this week's episode of Silverlight TV where John Papa talks with Shawn Wildermuth about Phoney, a new Open Source Project that will be showcased at MIX11 on April 11 th . ...( read more )...(read more)

Blend Bits 27–“Make it Flip”

Posted: 18 Mar 2011 04:30 AM PDT

This one comes from showing Blend to a few people yesterday and trying to think of various scenarios for making use of different visual states for a UI or for a control and one that came up was "can you make one of those UIs where we have a panel...( read more )...(read more)

Blend Bits 26–Use Libraries for Assemblies

Posted: 18 Mar 2011 01:46 AM PDT

One of the things that's a bit annoying with Expression Blend is that when you go to reference an assembly you get the standard Windows file open dialog. That is; raises the dialog; and that's not what you see in Visual Studio and makes hunting down the...( read more )...(read more)

Phone Tools reaches Beta!

Posted: 17 Mar 2011 04:26 PM PDT

URL : http://shawn.me/wp7phoney I am proud to announce the Beta version of the Phoney Tools. This version (v0.5) includes a few new features that are detailed below. The official release is still slated for MIX11! Changes in this version include: SelectSwitch...( read more )...(read more)

On Silverlight TV to Talk About Phoney Tools

Posted: 17 Mar 2011 04:07 PM PDT

URL : http://shawnw.me/dEUJJk I had the pleasure to join John Papa on Silverlight TV to talk about my Phoney Toolkit. If you get a chance take a look and see if you like what i've built. I got a chance to plug the upcoming Open Source Fest at MIX 11 as...( read more )...(read more)

Thursday, March 17, 2011

Visual Studio Template Behavior Research

Visual Studio Template Behavior Research


Visual Studio Template Behavior Research

Posted: 17 Mar 2011 08:30 AM PDT

I've been working on some stuff around templates lately and had my own opinions of some of the value of certain features of the Visual Studio template functionality. What I'm speaking of here is when you choose File… New Project or on an existing project...( read more )...(read more)

Visual Studio Template Behavior Research

Posted: 17 Mar 2011 08:30 AM PDT

I've been working on some stuff around templates lately and had my own opinions of some of the value of certain features of the Visual Studio template functionality. What I'm speaking of here is when you choose File… New Project or on an existing project Read More......(read more)

Marbles CMS

Posted: 14 Feb 2011 02:22 AM PST

Marbles aims to be a simple Content Management Server for hosting multiple websites.

Kate Gregory on Being a Most Valuable Professional (MVP)

Posted: 17 Mar 2011 09:00 AM PDT

Kate Gregory on Being an MVP

The 2011 MVP Global Summit took place a few weeks ago at MS headquarters. MVP stands for most valuable professional, a distinction that Microsoft assign to some prominent community personalities for their passion and dedication in helping the community get the most out of Microsoft technologies.

The MVP program has several disciplines, being C++ one of those. There are about 70 C++ MVPs world wide. This is the first of a series of interviews Charles Torre (our spy in Channel 9!) did recently to the C++ MVPs who attended the Summit. We start with Kate Gregory, a Canadian C++ MVP who recently was nominated "2010 C++ MVP of the Year" for the great job done in presenting sessions on C++ development at several MS conferences including recent and upcoming TechEd's, local codecamps, Channel 9 (we'll be posting some of her technical screencasts) and so forth. Kate is a great blogger as well.

Enjoy the chat!

SilverlightShow for March 7-13, 2011

Posted: 17 Mar 2011 06:12 AM PDT

Check out the Top Five most popular news at SilverlightShow for March 7-13, 2011. Here are the top 5 news on SilverlightShow for last week: SilverlightShow EcoContest Grand Prize Winner and First Runner-up Selected WCF RIA Services V1.0 SP1 Visual Studio...( read more )...(read more)

Silverlight & WCF RIA Services: Strategies for handling your Domain Context - Part 1

Posted: 16 Mar 2011 11:21 PM PDT

This is the first in a two-part article series on the WCF RIA Services Domain Context. Part 1: Introduction, instance strategies & first strategy Part 2: Other instance strategies, pointers & conclusion This article series is accompanied by source...( read more )...(read more)

Silverlight Cream for March 15, 2011 -- #1061

Posted: 16 Mar 2011 10:34 PM PDT

In this Issue: Peter Kuhn , Emil Stoychev , Viktor Larsson ( -2- ), Kevin Hoffman , Rudi Grobler , WindowsPhoneGeek , Jesse Liberty ( -2- ), and Martin Krüger . Above the Fold: Silverlight: "Image comparison using a GridSplitter" Martin Krüger WP7: "Using...( read more )...(read more)

Character Encoding in the .NET Framework

Posted: 16 Mar 2011 01:40 PM PDT

In addition to its support for Unicode (UTF-16) encoding, the .NET Framework supports a standard set of character encodings as well as numerous code pages. This topic discusses the .NET Framework's support for various character encodings, recommends which encoding to use in particular scanarios, discusses how to convert from one encoding to another, and documents the .NET Framework's support for different fallback strategies, which allow an encoder or decoder to handle unmappable characters or bytes.

Overview of Web Application Security Threats

Posted: 16 Mar 2011 11:10 AM PDT

An important part of developing a more secure application is to understand the threats to it. Microsoft has developed a way to categorize threats: Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege (STRIDE). This topic briefly describes these threats and how they apply to Web applications.

Upcoming speaking engagements on the Windows Phone

Posted: 16 Mar 2011 02:45 PM PDT

I wanted to share info on a few of the upcoming talks that I will be giving at a few conferences. If you're thinking of attending any of these, I think there will be plenty to learn! MIX 2011 (April) At Microsoft's own MIX 11 conference in Vegas, I will...( read more )...(read more)