TypeDescriptor Updates in .NET4

This is the fifth in my blog series on Visual Studio 2010 Designer Multi-Targeting A few updates were made to the TypeDescriptor classes to support multi-targeting: 1. TypeDescriptor.InterfaceType With the different VS project types came slightly different multi-targeting solutions.  Windows and Web Forms attached the TargetFrameworkProvider to control instances on the design surface.  Workflow projects…

0

Sorting on Dynamic Members at Runtime

Earlier this year I got to play with the DLR a little while working on the WebGrid for ASP.NET Web Pages.  I wanted the grid to work with the various LINQ providers, but it also had to support dynamic objects such as those returned by the new simple data APIs.  This began my investigation into…

0

Enabling Multi-Targeting for Control Designers

This is the fourth in my blog series on Visual Studio 2010 Designer Multi-Targeting As mentioned in my previous post, the property grid filtering is implemented through the use of a TypeDescriptionProvider which reflects against the project’s target framework.  This multi-targeting provider is attached automatically (via TypeDescriptor.AddProvider) for Windows and Web Forms controls that are…

0

Multi-Targeting Designer Services

This is the third in my blog series on Visual Studio 2010 Designer Multi-Targeting Visual Studio 2010 includes a number of services as part of the multi-targeting infrastructure: 1. TypeResolutionService, TypeDiscoveryService These services should be well known to WinForms and WebForms control designers.  They allow you to retrieve an assembly or type by name, find…

0

Excluding Code from MSTest Coverage Results

In order to write testable code, I sometimes need to add internal test APIs which take ASP.NET abstractions such as HttpContextBase.  At runtime I use the public wrapper, however my tests just call directly into the internal helper: public void DoSomething() { DoSomethingInternal(new HttpContextWrapper(HttpContext.Current); } internal void DoSomethingInternal(HttpContextBase context) { // do actual work }…

0

Designer Filtering using Reference Assemblies

This is the second in my blog series on Visual Studio 2010 Designer Multi-Targeting. Visual Studio 2010 expands multi-targeting support to include metadata filtering in features such as intellisense and the property grid.  Notice how the property grid filters out the new ClientIDMode property added to web controls in .NET 4 when targeting .NET 2:…

2

XHTML Validation with XmlReader

As a developer on the ASP.NET team, it’s hard for me to avoid writing HTML.  And it’s important for that HTML to follow web standards for a variety of reasons.  I was recently fixing some bugs where I was outputting non-compliant XHTML when I thought, “I should have unit tests for this”. Fortunately, .NET’s System.Xml.XmlReader…

0

Visual Studio 2010 Designer Multi-Targeting

Visual Studio 2010 has been out for a couple of weeks now.  What a great time for me to kick off a new blog to discuss some of the insights and contributions I made to the designer multi-targeting experience.  I’ll be focusing on new features in VS 2010, how they work, and guidance for how…

0

A Project’s Target Framework

This is the first in my blog series on Visual Studio 2010 Designer Multi-Targeting.  When creating a new project in Visual Studio, you must select which framework you’re targeting: This setting is stored in your project file: <PropertyGroup> … <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkProfile>Client</TargetFrameworkProfile> </PropertyGroup> When you build this project, msbuild will automatically inject a TargetFrameworkAttribute into the…

0