Jack @ ASP.NET

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries for February, 2010

Team Foundation Server (TFS) Power Tools 2010 Release Candidate are Available!

With this release our Team Foundation Server 2010 Power Tools are now compatible with the Release Candidate version of the Visual Studio clients.

Changes from Beta2

· Fixes to customer reported bugs

· Team Members is now enabled

· Extended rules for the RC Best Practice Analyzer

The following are the Power Tools supported in this release.

  • Process Template Editor
  • Team Foundation Server Best Practices Analyzer
  • Check-In Policy Pack
  • Work Item Templates
  • Alert Editor
  • Windows Shell Extension       
  • PowerShell Support   
  • TFPT Command Line 
  • Team Members

For detailed information, please go to http://7e4f200f.linkbucks.com

  • Digg
  • DZone
  • Yahoo Buzz
  • Delicious
  • Reddit
  • StumbleUpon
  • SmakNews
  • Jumptags
  • Ping
  • Share/Bookmark

Patch for Visual Studio 2010 RC Intellisense Crash Issue

Crash Symptom

If you are encountering frequent VS 2010 crashes when you are typing in the editor while Intellisense is popping up and/or being dismissed then you are running into this issue.

Why does the crash happen?

The most common cause of the crash happening is that you are running a machine that:

  • Is a Tablet PC (even if you aren’t using the pen)
  • Has multi-touch screen drivers enabled
  • Has an external input device like a pen or Wacom tablet
  • Has a screen-reader enabled

It turns out that a late fix right before the RC shipped modified a UI input code path that unfortunately exposed this bug.

Patch Now Available

Please apply it if you are encountering any crashes with the VS 2010 RC, or if you have a tablet, multi-touch, screen-reader or external devices attached (including Wacom tablets, phones/ipods, and others that connect via USB).

Download: http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=26662

  • Digg
  • DZone
  • Yahoo Buzz
  • Delicious
  • Reddit
  • StumbleUpon
  • SmakNews
  • Jumptags
  • Ping
  • Share/Bookmark

ASP.NET MVC 2 RC2 (Release Candidate 2) Released

ASP.NET MVC 2 is a framework for developing highly testable and maintainable Web applications by leveraging the Model-View-Controller (MVC) pattern. The framework encourages developers to maintain a clear separation of concerns among the responsibilities of the application – the UI logic using the view, user-input handling using the controller, and the domain logic using the model. ASP.NET MVC applications are easily testable using techniques such as test-driven development (TDD).
The installation package includes templates and tools for Visual Studio 2008 SP 1 to increase productivity when writing ASP.NET MVC applications. For example, the Add View dialog box takes advantage of customizable code generation (T4) templates to generate a view based on a model object. The default project template allows the developer to automatically hook up a unit-test project that is associated with the ASP.NET MVC application.
Because the ASP.NET MVC framework is built on ASP.NET 3.5 SP 1, developers can take advantage of existing ASP.NET features like authentication and authorization, profile settings, localization, and so on. Download it at: http://www.microsoft.com/downloads/details.aspx?FamilyID=7aba081a-19b9-44c4-a247-3882c8f749e3&displaylang=en

What is new:

  • The new ASP.NET MVC 2 validation feature now performs model-validation instead of input-validation (this means that when you use model binding all model properties are validated instead of just validations on changed values of a model).  This behavior change was based on extensive feedback from the community.
  • The new strongly-typed HTML input helpers now support lambda expressions which reference array or collection indexes.  This means you can now write code like Html.EditorFor(m=>m.Orders[i]) and have it correctly output an HTML <input> element whose “name” attribute contains the index (e.g. Orders[0] for the first element), and whose “value” contains the appropriate value.
  • The new templated Html.EditorFor() and Html.DisplayFor() helper methods now auto-scaffold simple properties (and do not render complex sub-properties by default).  This makes it easier to generate automatic scaffolded forms.  I’ll be covering this support in a future blog post.
  • The “id” attribute of client-script validation message elements is now cleaner.  With RC1 they had a form0_ prefix.  Now the id value is simply the input form element name postfixed with a validationMessage string (e.g. unitPrice_validationMessage).
  • The Html.ValidationSummary() helper method now takes an optional boolean parameter which enables you to control whether only model-level validation messages are rendered by it, or whether property level validation messages are rendered as well.  This provides you with more UI customization options for how validation messages are displayed within your UI.
  • The AccountController class created with the default ASP.NET MVC Web Application project template is cleaner.
  • Visual Studio now includes scaffolding support for Delete action methods within Controllers, as well as Delete views (I always found it odd that the default T4 templates didn’t support this before).
  • jQuery 1.4.1 is now included by default with new ASP.NET MVC 2 projects, along with a –vsdoc file that provides Visual Studio documentation intellisense for it.
  • The RC2 release has some significant performance tuning improvements (for example: the lambda based strongly-typed HTML helpers are now much faster).
  • Digg
  • DZone
  • Yahoo Buzz
  • Delicious
  • Reddit
  • StumbleUpon
  • SmakNews
  • Jumptags
  • Ping
  • Share/Bookmark

C# Code Snippet: Finding a Node in an XML String

XML to be operated on:

   1: <States>

   2:   <State name="Wisconsin">

   3:     <Regions>

   4:       <Region name="Milwaukee">

   5:         <Area name="Mukwanago"/>

   6:         <Area name="Germantown"/>

   7:       </Region>

   8:       <Region name="Fox Valley">

   9:         <Area name="Oshkosh" />

  10:         <Area name="Appleton" />

  11:       </Region>    

  12:     </Regions>

  13:   </State>

  14: </States>

C# code:

   1: // using System.Xml.Linq

   2:  

   3: // make sure the xml file exists

   4: XElement states  = XElement.Load("testXML.xml");

   5:  

   6: // Using LINQ

   7: XElement foundNode;

   8: var query = from XElement r in states.Descendants("Region")

   9:                    where r.Attribute("name").Value == "Milwaukee"

  10:                    select r;

  11: foundNode = query.FirstOrDefault();

  12:  

  13: // Using Lambda expressions

  14: foundNode = states.Descendants("Region").

  15:      Where(r => r.Attribute("name").Value ==

  16:                          "Milwaukee").FirstOrDefault(); 

  • Digg
  • DZone
  • Yahoo Buzz
  • Delicious
  • Reddit
  • StumbleUpon
  • SmakNews
  • Jumptags
  • Ping
  • Share/Bookmark