Friday, January 11, 2008

Visual Studio 2008 Features

What's New in Visual Studio 2008

Even though I just said that Visual Studio 2008 doesn't look to be a revolutionary upgrade, that doesn't mean there aren't plenty of goodies to go around. Some of the notable improvements include:
  • LINQ support
  • .NET Framework 3.5 support
  • ASP.NET AJAX now built into the .NET Framework
  • Improved JavaScript Intellisense and debugging
  • Improved Web designer with better CSS support (based on Expression Web)
  • Nested Master Pages
  • ASP.NET ListView control
  • Multi-targeting - allows you to target different versions of the .NET Framework. Finally one dev environment for .NET 2.0, 3.0, and 3.5!!!

Friday, January 04, 2008

Service-Oriented Architecture

A service-oriented architecture (SOA) is a collection of services which thus lead to automation logic. These services may or may not communicate with each other to accomplish the application task...

When we say services, it refers to a discretely defined set of contiguous and autonomous business or technical functionality. A service is much like a function that is well-defined, self-contained, and does not depend on the context or state of other services. In fact, they just provide/offer a service by it’s own.

The term service oriented approach is not new; it is there from the long olden age of COM /DCOM and still survives and finds its existence in the software architecture space. Recently Microsoft has used this approach to design and implement WCF (Windows Communication foundation formerly known as Indigo) in Microsoft .Net framework 3.0
In an SOA environment independent services can be accessed without knowledge of their underlying platform implementation or other internal details which helps us greatly in interconnection like scenarios.Normally in this scenario, there will be a service consumer or service agent sending a service request message to a service provider. The service provider returns a response message to the service agent. The request and subsequent response connections are defined in some way that is understandable to both the service consumer and service providerOne of the other features of this approach is that the client is not tightly coupled to these services, both the client and services are independent of each other, thus the client is free to interact with whatever services are required

Thursday, January 03, 2008

Accessing Master Page Properties from a content page

Accessing a property on a MasterPage from the content page. One merely has to check the namespace and the class name of the masterpage, which can be found in the code behind file. Just cast the Content Page’s Master as the class of the masterpage file which it uses, and then access the value.
One way of doing this in the content page,

int valueNeeded = ((MyNameSpace.MyMasterPageClassName)Master).MyProperty;

Or you can do this by doing like this in ContentPage.aspx page
<%@ MasterType VirtualPath="~/MasterPage.master" %>
Just below the Page directive and then you can access the proeprty in codebehind in content file as as:

int valueNeeded = Master.MyProperty;

Using these methods you can access a property of a masterpage file.

VS 2008 Features and support

The official name for the .NET Framework "Orcas" release will be called .NET Framework 3.5 (it includes the new LINQ support, integrated ASP.NET AJAX support, new ASP.NET data controls, and more).


Past few releases of Visual Studio, each Visual Studio release only supported a specific version of the .NET Framework. For example, VS 2002 only worked with .NET 1.0, VS 2003 only worked with .NET 1.1, and VS 2005 only worked with .NET 2.0.

One of the big changes starting with the VS 2008 release is to support "Multi-Targeting" - which means that Visual Studio will now support targeting multiple versions of the .NET Framework, and developers will be able to start taking advantage of the new features Visual Studio provides without having to always upgrade their existing projects and deployed applications to use a new version of the .NET Framework library.

Now when you open an existing project or create a new one with VS 2008, you can pick which version of the .NET Framework to work with - and the IDE will update its compilers and feature-set to match this. Among other things, this means that features, controls, projects, item-templates, and assembly references that don't work with that version of the framework will be hidden, and when you build your application you'll be able to take the compiled output and copy it onto a machine that only has an older version of the .NET Framework installed, and you'll know that the application will work.

Creating a new project in VS 2008 that targets .NET 2.0. While creating a project you can notice with dropdown with different .NET framework in it. You can select what type of Framework you want to use.After you select the framewrork, it will automatically filter the project list to only show those project templates supported on machines with the .NET 2.0 framework installed. If you create a new ASP.NET Web Application with the .NET 2.0 dropdown setting selected, it will create a new ASP.NET project whose compilation settings, assembly references, and web.config settings are configured to work with existing ASP.NET 2.0 servers.

why use VS 2008 if you aren't using the new .NET 3.5 features?

Well, the good news is that you get a ton of tool-specific value with VS 2008 that you'll be able to take advantage of immediately with your existing projects without having to upgrade your framework/ASP.NET version. A few big tool features in the web development space I think you'll really like include:
  • JavaScript intellisense
  • Much richer JavaScript debugging
  • Nested ASP.NET master page support at design-time
  • Rich CSS editing and layout support within the WYSIWYG designer
  • Split-view designer support for having both source and design views open on a page at the same time
  • A much faster ASP.NET page designer - with dramatic perf improvements in view-switches between source/design mode
  • Automated .SQL script generation and hosting deployment support for databases on remote servers

And also, you can upgrade or downgrade to any version on .NET framewrok by pulling properties and selecting the desired framework you want. This will automatically remove the newer assembly references from your project, update your web.config file, and allow you to compile against the older framework (note: if you have code in the project that was written against the new APIs, obviously you'll need to change it).

What about .NET 1.0 and 1.1?

Unfortunately the VS 2008 multi-targeting support only works with .NET 2.0, .NET 3.0 and .NET 3.5 - and not against older versions of the framework. The reason for this is that there were significant CLR engine changes between .NET 1.x and 2.x that make debugging very difficult to support. In the end the costing of the work to support that was so large and impacted so many parts of Visual Studio that we weren't able to add 1.1 support in this release.
VS 2008 does run side-by-side, though, with VS 2005, VS 2003, and VS 2002. So it is definitely possible to continue targeting .NET 1.1 projects using VS 2003 on the same machine as VS 2008.

About the Enterprise Library 3.1

The Microsoft patterns & practices Enterprise Library is a collection of application blocks that can help simplify many common enterprise development challenges. This release of Enterprise Library includes application blocks for Caching, Cryptography, Data Access, Exception Handling, Logging, Policy Injection, Security and Validation.

Application Blocks are reusable, extensible source-code components that provide guidance for common development challenges

Enterprise Library is a collection of general purpose application blocksCaching, Configuration, Cryptography, Data Access, Exception Handling, Logging, SecurityEmphasis on Consistency, Extensibility, Ease of Use and IntegrationOriginally designed for .NET Framework 1.1 (January/June 2005 releases) and updated for .NET Framework 2.0 (January 2006 release)

New application blocks
  • Validation Application Block
  • Policy Injection Application Block

Improvements to existing application blocks

  • Data Access Application Block
  • Logging Application Block

.NET Framework 3.0 integration

  • Logging, Exception Handling and Validation Application Blocks

Configuration improvements

  • Visual Studio-integrated configuration tool
  • Environmental Overrides
  • Manageable Configuration Source


  • Application Block Software Factory
  • Strong Naming Guidance Package

Migrating from Earlier Releases
In general, applications built using Enterprise Library for .NET Framework 2.0 – January 2006 will function with the Enterprise Library 3.0 or the Enterprise Library 3.1 without the need for any code changes. It will be necessary to update the references to refer to the new assemblies and to update the configuration files to reference the correct version of the assemblies.

Get it from here.... Enterprise Library 3.1 Download