Install a shared Assembly to the GAC as post build event from Visual Studio

The Global Assembly Cache (GAC) is a Cache for globally available Assemblies. Most of the shared assemblies are installed inside GAC to shared across different applications. The Global Assembly Cache tool (Gacutil.exe) allow us to manipulate the contents of the global assembly cache along with install and un-install Assembly. During the development, we generally  take help of gacutil from command prompt to install or uninstall assemblies into or from GAC. This is a repetitive process, every time you made some changes in your library you might need to deploy it into the GAC. Visual Studio has a nice feature called Pre-Build and Post-Build events. Using these events we execute some specific  commands before or after the build. In this post I am going to show you how we can configure the post build event to deploy an Assembly to GAC.

Different Version of Integrated Web Server in Visual Studio 2010

While running your ASP.net application you might have found it to be running on Integrated Web development environment. Visual Studio 2010 comes with two version of Integrated Web Development environment which could run side by side. In case you run your ASP.NET application in VS 2010 you can have an option to choose between the two version of Web Development environment, one running CLR 2.0, which was there before VS2010 and a new version of Web Dev with CLR 4.0. Multi – targeting allows you to configure your visual studio to run more than one Web Dev server at a time one using CLR 2.0 and another using CLR 4.0

In one of my ASP.NET Online session I had talked about the multi targeting features of Visual Studio 2010 for web development. During the demo I have shown, how we can target two different version of .NET CLR version same time. Some of the attendees having some doubts on that, So in this blog post, I am going to explain how we can target two different version of CLR at same time.

To demonstrate it, Start with a new Visual Studio Instance, and Create a solution file which contains two different Framework version of web applications.  Let’s say there are two web application which are targeting to ASP.NET 3.5 and ASP.NET 4.0 version.

1 2

Update : ASP.NET 4.0 – In Depth Session – Download Video and PPT

Today I have given an Online session on “ASP.NET 4.0 – In Depth” with Abhishek in a community event organized by DotNetFunda.Com. Thanks to all the attendees. As we were running out of time, we will continue the same in a different session on rest of the topic.  All the nominated users will get an email for next session details.

Things that we have covered already :

  1. Basic Introduction of ASP.NET 4.0 Features
  2. Visual Studio 2010 Enhancement Session for ASP.NET 4.0 (With Demo)
  3. Server Control Enhancements (With Demo)
  4. Search Engine Optimization (With Demo)

Whatever we have covered till now, ready to download

ASP.NET 4.0 In-Depth Session videos, PPT and source code

We have lots of things to cover and probably we will fix a time later in the up coming weekends and update you the same.

Below topics we will cover in out next sessions

   1. State Management  improvement in ASP.NET 4.0  ( With Demo)

   2. Deployment in ASP.NET 4.0 ( with Demo )

   3. Client Side improvement ( With Demo )

   4. Dynamic Data ( With Demo)

Apart from those topic I will discuss few tips and tricks of ASP.NET 4.0

We will be update soon with our next session date and time. Thanks again for joining.

Regards,

Abhijit

“CompressionEnabled” Session in ASP.NET 4.0

Session is the most important state management mechanism for a web application. In ASP.NET we are having two type of state management

1. In Process

2. Out Process

In process” is the by default session storage mode for ASP.NET Web application. When it comes under Out Process we can use either of state server or SQL Server to persist our session data.

Here I am going to describe one new features added in ASP.NET 4.0 realted with Session. If you want to know about when to use session, what session mode to use, how to configure the session storage please read one of my article “Exploring Session in ASP.NET” published at CodeProject.

In case of In Process, session data stored in In memory of worker process. But when we are talking about “OutProc” session mode, we need to ensure that session data should be “Serialized” first  . So, when we are moving session data from Web Server to Out Process Server ( State Server or SQL Server ) it can be a performance overhead based on the size of data that we are stroing in Session.

ASP.NET 4.0 comes us with a new option for compressing the Session data with Out Process Session mode. To enabling this functionality we need to add “compressionEnabled=”true” attribute with the SessionMode in web.config . Web.config entry would be look like below,

<sessionState mode="SQLServer" sqlConnectionString="Integrated Security=SSPI; data source=.;" <em>compressionEnabled="true" </em>allowCustomSqlDatabase="true">

This will compress / Decompress the session data during serialization / deserialzation of session data. ASP.NET 4.0 used System.IO.Compression.GZStream class to compress the session mode. One more important things to remember that use of compression mode is useful when we are storing large number of data in session because for every request it will going to use Gzip Compression/ Decompression going to be used to access the session variable.

Hope this will helps you !

Shout it