July 2009 Entries
Visual Studio 2008 (SP1) crashes on opening a solution – Event Name CLR20r

I have encountered this problem on two different occasions.

In each case, I had made only minimal code changes before Visual Studio hung while running the solution in debug build configuration. In the once case, I had added a new class file and some code to use the class. In the other case, I had only modified parameters to methods and some class constructors. I had also set several new breakpoints and bookmarks in code relating to the changes I had made.

The only way to deal with the hung process was kill the devenv.ex process in Windows Task Manager. After this, I was not able to open the solution in Visual Studio again. Other solutions could be open and runs as per normal in the IDE.

During the process of opening the solution, Visual Studio’s status bar displays the progress of the projects /files being loaded. Then ‘Ka Boom’, the below dialog is displayed.

clip_image002

The full detail of the problem in the above screen shot, is listed below:

Problem signature:

Problem Event Name: CLR20r3

Problem Signature 01: devenv.exe

Problem Signature 02: 9.0.30729.1

Problem Signature 03: 488f2b50

Problem Signature 04: System

Problem Signature 05: 2.0.0.0

Problem Signature 06: 4889de7a

Problem Signature 07: 5a2

Problem Signature 08: 0

Problem Signature 09: System.TypeInitialization

OS Version: 6.0.6001.2.1.0.256.6

Locale ID: 2057

Additional information about the problem:

LCID: 1033

Read our privacy statement:

http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409

 

Nice one! The information contained in the dialog is not helpful. Neither are the options that are provided. Options 1 & 2 only get one stuck in a continual loop of Open-Crash-Open for the solution. Attempts to debug the problem (Option 3) reveal rather useless information for a general developer trying to identify the problem.

My attempts to open solution included: (1) System hard and soft re-boots ; (2) Getting the latest version of the solution from Team Foundation Server; (3) Rolling back changes I had made; and (4) eliminating Visual Studio Add-ins such as Jet Brains Resharper (ver sion 4.5). None of these helped. Blog post and information I found on forums about this issue do not reveal a consistent resolution to the problem (with some folk even reinstalling Visual Studio 2008 and the service packs; others removing and adding references from projects; or removing and re-adding projects in the solution).

I deleted the *.sou file for the solution and I was up and running sans my break points and bookmarks. So maybe the .sou file had become corrupted or Visual Studio was not able to deal with some combination of the elements it stores. Who cares? I was going again! Hopefully this might serve as a quick first option to resolve the issue for those who encounter it.

ASP.Net 4.0 Heads-up

 Mike Ormond (Microsoft UK) presented a “What’s new in ASP.Net 4.0” at this month’s Southampton NxtGenUg meeting. While there appears to be no major technology change, there are a host of changes to enhance performance; and augment the current user and developer experience (ASP.Net 3.5). The discussion focused primarily on the new features in the Presentation Layer. It was a pretty lively as Mike competed head to head with a brass band practicing in the adjoining room of the Venue. Mike deliver key points in sync with many crescendos of the Harry Potter and other theme tunes . Good effort!

The next Southampton NxtGenUp meeting is scheduled for August 20th. Redgate Software Test Engineer Ben Hall will be talking about testing ASP.Net applications.

For for those who have not yet had a chance to play with the Beta 2 versions of Visual Studio 2010 and not able to attend the session, I have listed some of the content below.

 

Routing handler - WebForRoutHandler

The same routing mechanism as used in MVC is provided for ASP.Net web pages. This is used to intercept requests to extract data or to direct requests as per the routing table information. In a similar fashion to ASP.Net MVC, the routing information is added to the application’s RouteTable in the Global.asax file. Check out Scott Galloway’s blog for more.

 

image

 

 Page.Keywords and Page.Description properties

Assigning values to the Meta tag new Keyword and Description properties results in the values of these properties being rendered to the page as Keyword and Description.

 

image

 

 ClientIDMode property

If this property is set to Static, then the IDs of the related control will not be altered by ASP.Net in the rendered page. This is good news when using jQuery as you no longer have to do the magic to locate controls at runtime.

If the ClientIDMode property is set to Predictable, the same is achieved in Repeater and GridView controls where, for instance, a check box is rendered for each row of data. The checkboxes will be rendered with sequential numbers, ( CheckBox_05, CheckBox_06 …). The rendered name can be even further fine-tuned by specifying a ClientIDRowSuffix to be applied to each control specified in the ItemTemplate element nested in the TemplateField element. The rendered control IDs of the labels with the ID=”user” in the below code will be UserSuffix_UserID_1, UserSuffix_UserID_2 etc.

ASP.NET currently generates pretty long names for the controls. Several hundred rows of long generated names will inevitably result in page bloat and performance issues. A further benefit of being able to control IDs of rendered controls (such as in repeaters), is that when a page is configured to use View State, its size can be limited to some degree.

 

image

 

ListView EnablePersistedSelection property

Consider the situation in ASP.Net 3.5, where a ListView with Paging is populated with data extending over more than one page. If the user selects a Row – say Row 3 - and then navigates to subsequent pages, Row 3 remains selected in the subsequent pages of the ListView (provided the it contains at least 3 rows of data). In ASP.Net, this behaviour can be disabled by setting the EnablePersistedSelection to false. Mike describes this and some of the below changes (with screen shots) in his blog here.

  

FormView rendering

In the current version of ASP.Net FormView always renders as a table. A RenderTable property of the FormView Control has been provided in ASPNet 4.0. If this is set to false the control will not be rendered as a table.

 

 QueryExtender Control

This control works with LinqDataSources or EntityDataSources. Properties that can be applied to order and filter data. Doing so will essentially extend the Linq expression tree for the query. Some of the attributes are:

  • OrderByExpression – obviously orders the queried data.
  • RangeExpression – obviously specifies the range of data to be returned.
  • Parameters – parameters passed into the query

 

image

 

Control level View State rendering

ASP.Net 3.5 allows one to disable View State at the page level. In Asp.Net 4.0, the View State can be set to render at a control level. Controls inherit View State rendering from their container. Therefore, if the View State is disabled at the page level, a developer can enable View State if required at a control level.

  

 

Compressed Session State

Session state can to be compressed for State Server or SQL Server persistence prior to being sent across the wire. When configured for compression (set in the web.config file), the Session State will be compressed using GZip.

  

 

Caching

Caching is being factored out of the Web namespace. This will permit the .Net Framework caching to be used in Winforms / WPF applications without the need for referencing Web assemblies.

 

 Ajax

Mike talked about the Ajax enhancements which are quite compelling. There are probably too many to try and list them in this blog but the new DataView ASP.Net Ajax control allows declarative data binding is worth mentioning. The DataContext handles tracking of data changes therefore permitting batch operations. More on this can be found here on the official ASP.Net Website

 

The following URI points to a white paper describing the above changes and others made to ASP.Net 4.0 B1 version. http://www.asp.net/learn/whitepapers/aspnet40/