Unable to Start Web Site on IIS – “Process can not access the file because It’s being used by another process”. How to resolve ?

I was trying to run one of my local IIS hosted site I got page not found error. I was quite surprised to see that error because the site was up and running few hours back. I opened the IIS and found that my Site Application was in stopped mode. I started the web application and got the error message displayed below

Problem : Error message “Process can not access the file because It’s being used by anther process”  while starting the web application from IIS.

Investigation and Resolution:  Earlier my web site was running on the default IIS port ( Port 80 ).  From the error message it’s clear that port 80 is being used by some other process or some one is blocking it.

Bing Maps Silverlight Control Integration with SharePoint 2010 – Integration of Silverlight 4 with SharePoint 2010

In this article I have demonstrated how we can integrate a Silverlight Application with SharePoint 2010. I have used Bing Maps Control for Silverlight as example.



Development Environment

I have used below development Environment for this application

1. Visual Studio 2010 Ultimate Edition

2. SharePoint 2010 Server

3. Silverlight 4.0 Toolkit

4. Bing Maps Silverlight Control SDK

Before starting development you have to install “Bing Maps Silverlight Control SDK” as a prerequisite. You can download the same from “Bing Maps Silverlight Control SDK” .Once you are done with the setup of Development environment the first thing you need to do is to register and create an account at https://www.bingmapsportal.com/ . Once you registered on bing maps portal, you need to provide below information to get an access key for using Bing Maps.

Custom web parts not getting displayed after deployment in share point 2010. how to resolve ?

In Share point 2010, we can create Visual Web parts very easily from Visual studio and can deploy it directly from Visual Studio. After deployment, when adding a web part on a sharepoint page you might face the issue that custom web parts are not getting displayed under custom web parts section though your deployment was successful from Visual Studio.

Fig :  No web parts after deployment

This problem might happen due to activation of features list of your corresponding web parts.  To resolved this issue you need to perform the following steps.

How to update controls which are outside of updatepanel during partial page rendering?

we generally used update panel to do the partial page postback, which means to postback the controls which are only inside the update panel. For achieve this we simply call Update() method for the corresponding Update Panel. This thing is quite simple when we are trying to update any control which is inside the updatepanel itself. But, The problem may come when we want to update the controls which are outside of UpdatePanel and we need to update the same while updating then control inside updatepanel.

To make it simple. Let’s consider below scenarios. In our web page, we have Two labels (Label1 and Label2). Lable1 present inside the updatePanle and Label2 is in the outside of updatePanel. We have one Button say Button1, which is also inside the UpdatePanel. Now, our requirement is to update the Label2 while we are updating Label1 by Clicking Button1.

below is the code block for above scenarios

      <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode=Conditional>
            <ContentTemplate>
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                <asp:Button ID="Button1" runat="server" Text="Update Button"  onclick="Button1_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
     <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>

Now, if we click on “Button1”, it will update only the content of Label1 not Lable2.

The solutions is to use ScriptManager.RegisterDataItem() . Using RegisterDataItem() methods we can register any control with the Particular Page ScriptManager Instance. While registering we need to provide the Control name along with the data item for the control which we want to render.

IntelliTrace Debugging – Video Demo

Recently I have published one complete tutorial on Visual Studio 2010 Debugging. Which covered almost all main features of debugging in Visual Studio 2010 like Basic of Breakpoints,  breakpoint labeling, data tips, multithreaded debugging, and parallel debugging and IntelliTrace debugging. You can read the complete article from My Blog or from CodeProject.

While preparing the article I had created one small video on IntelliTrace Debugging which will show you the demo of using IntelliTrace Debugging.  Hope you will enjoy this video.

kick it on DotNetKicks.com

Mastering in Visual Studio 2010 Debugging

Visual Studio IDE gives us a lot of tools to debug our application. Sometimes debugging activity takes a very long time to identify the root cause. But VS IDE provides a lot of handy tools which help to debug code in a better way. Debugger features include error listing, adding breakpoints, visualize the program flow, control the flow of execution, data tips, watch variables and many more. Many of them are very common for many developers and many are not. In this article, I have discussed all the important features of VS IDE for debugging like Breakpoint, labeling and saving breakpoints, putting conditions and filter on breakpoints, DataTips, Watch windows, Multithreaded debugging, Thread window, overview of parallel debugging and overview of IntelliTrace Debugging

“Spotlight” – Microsoft’s official website www.asp.net

I am happy to inform that one of my article “Beginner’s Guide: How IIS Process ASP.NET Request” published at DotNetFunda.Com has been featured at Microsoft’s official website www.asp.net as Spotlight .

This article has also been selected asArticle of the day” at asp.net site few weeks back. This time I am quite excited to see  the article in Spotlight section.

Thanks to DotNetFunda and Thanks to all of you for your good wishes.
You can read all of my article here

“Article of the day” @ Microsoft’s official website www.asp.net

It’s great to see one of my another article “Beginner’s Guide: How IIS Process ASP.NET Request” has been selected as “Articles of the Day” in Microsoft’s official Web sitesite  asp.net . It’s always great to see any article as “Article of The Day” in asp.net site.

This article describes how IIS process any incoming ASP.NET request. This also described diiferent level of IIS, Application Pool, Worker Process and also how request flows from different HTTPModule, HTTPHanlder and finally starts the Page Lifecycle.

I have represent this articles with many diagrams, so it can helps beginners to learn and remember easily.

You can find complete article in DotNetFunda.com .

Visual Studio 2010 – Launch Date – Today


Finally the day has come. 12th April(Today) is the launch date of .NET Framework 4.0 with Visual Studio 2010. VS 2010 Beta 1 was launched on 18th may 2009. After five months Microsoft launched VS 2010 Beta-2 on 21st October 2009.  Microsoft released the Release candidate (RC) Version of VS 2010 on 10th Feb 2010. Now, finally 12th April -2010 is going to be biggest day for .NET world as Visual Studio 2010 launching today.

Visual studio 2010 and .NET Framework 4.0 came up with many new features for next generation developers. Below are the few lists of features that are available with VS 2010

Visual Studio 2010 IDE and .NET Framework 4.0

  • Call Hierarchy of methods
  • A New Quick Search
  • Multi-targeting
  • Multi-Monitor
  • Parallel Programming
  • Visual Debugging
  • XSLT Profiling and Debugging
  • The XSD Designer
  • Code Navigation in Class Files
  • Code Identifier Highlighting

New ASP.NET features

  • Static IDs for ASP.NET Controls
  • Web.config transformation
  • URL Routing and SEO
  • Compressing Session Values
  • MetaKeyword and MetaDescription
  • Generating Client IDs
  • Permanent Redirect

New C# features

  • Dynamic Types
  • Optional parameters
  • Named and Optional Arguments

This are only few list of features, there are many more features available.  Over couple of months I came across many good articles on  Visual studio 2010 and .NET 4.0. Below are few of them. It may help many of guys who are just start working with VS 2010 or Thinking for start with

http://dotnetslackers.com/articles/net/Visual-Studio-2010-and-NET-Framework-4-IDE-Enhancements-Part1.aspx

http://dotnetslackers.com/articles/net/Visual-Studio-2010-and-NET-Framework-4-IDE-Enhancements-Part2.aspx

http://dotnetslackers.com/articles/net/Visual-Studio-2010-and-NET-Framework-4-IDE-Enhancements-Part3.aspx

http://weblogs.asp.net/scottgu/archive/2010/03/30/cleaner-html-markup-with-asp-net-4-web-forms-client-ids-vs-2010-and-net-4-0-series.aspx

http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx

http://weblogs.asp.net/scottgu/archive/2009/10/29/add-reference-dialog-improvements-vs-2010-and-net-4-0-series.aspx

http://weblogs.asp.net/scottgu/archive/2009/10/22/vs-2010-code-intellisense-improvements-vs-2010-and-net-4-0-series.aspx

http://weblogs.asp.net/scottgu/archive/2010/01/05/asp-net-4-seo-improvements-vs-2010-and-net-4-0-series.aspx

http://weblogs.asp.net/scottgu/archive/2010/01/27/extensible-output-caching-with-asp-net-4-vs-2010-and-net-4-0-series.aspx

http://www.codedigest.com/Articles/ASPNET/284_New_Features_in_ASPNet_40-PART_1.aspx

http://www.codedigest.com/Articles/ASPNET/285_New_Features_in_ASPNet_40-PART_1.aspx

http://www.asp.net/LEARN/whitepapers/aspnet4/

http://www.dotnetfunda.com/articles/article815-whats-new-in-visual-studio-2010-.aspx

“Article of the day” @ Microsoft’s official website www.asp.net

Today morning I came across one news that,  my another article  “Filter GridView Records using AJAX Slider Control” has been selected as “Articles of the Day” in Microsoft’s official Web sitesite  asp.net . It’s always great to see any article as “Article of The Day” in asp.net site.

This article shows, how to sort the gridview content using AJAX Slider control.

You can find complete article in DotNetFunda.com .

Beginner’s Guide: How IIS Process ASP.NET Request

Introduction

When request come from client to the server a lot of operation is performed before sending response to the client. This is all about how IIS Process the request.  Here I am not going to describe the Page Life Cycle and there events, this article is all about the operation of IIS Level.  Before we start with the actual details, let’s start from the beginning so that each and everyone understand it’s details easily.  Please provide your valuable feedback and suggestion to improve this article.

What is Web Server ?

When we run our ASP.NET Web Application from visual studio IDE, VS Integrated ASP.NET Engine is responsible for executing all kind of asp.net requests and responses.  The process name is “WebDev.WebServer.Exe” which takes care of all request and response of a web application which is running from Visual Studio IDE.
Now, the name “Web Server” comes into picture when we want to host the application on a centralized location and wanted to access from many places. Web server is responsible for handle all the requests that are coming from clients, process them and provide the responses.

What is IIS ?

IIS (Internet Information Services) is one of the most powerful web servers from Microsoft that is used to host your ASP.NET Web application. IIS has its own ASP.NET Process Engine to handle the ASP.NET request. So, when a request comes from client to server, IIS takes that request and process it and send the response back to clients.

Request Processing :

Hope, till now it’s clear to you that what is the Web server and IIS is and what is the use of them. Now let’s have a look how they do things internally. Before we move ahead, you have to know about two main concepts

1.    Worker Process
2.   Application Pool

Worker Process:  Worker Process (w3wp.exe) runs the ASP.Net application in IIS. This process is responsible for managing all the request and response that are coming from the client system.  All the ASP.Net functionality runs under the scope of the worker process.  When a request comes to the server from a client worker process is responsible for generating the request and response. In a single word, we can say worker process is the heart of ASP.NET Web Application which runs on IIS.
Application Pool: Application pool is the container of the worker process.  Application pools are used to separate sets of IIS worker processes that share the same configuration.  Application pools enable a better security, reliability, and availability for any web application.  The worker process serves as the process boundary that separates each application pool so that when one worker process or application is having an issue or recycles, other applications or worker processes are not affected. This makes sure that a particular web application doesn’t impact other web application as they are configured into different application pools.

Application Pool with multiple worker processes is called “Web Garden.”
Now, I have covered all the basic stuff like the Web server, Application Pool, Worker process. Now let’s have a look how IIS process the request when a new request comes up from a client.
If we look into the IIS 6.0 Architecture, we can divide them into Two Layer

1.    Kernel Mode
2.    User Mode

Now, Kernel mode is introduced with IIS 6.0, which contains the HTTP.SYS.  So whenever a request comes from Client to Server, it will hit HTTP.SYS First.

Now, HTTP.SYS is Responsible for pass the request to the particular Application pool. Now here is one question, How HTTP.SYS does come to know where to send the request?  This is not a random pickup. Whenever we create a new Application Pool, the ID of the Application Pool is being generated, and it’s registered with the HTTP.SYS. So whenever HTTP.SYS Received the request from any web application, it checked for the Application Pool and based on the application pool it sends the request.

So, this was the first steps of IIS Request Processing.
Till now, Client Requested for some information and request came to the Kernel level of IIS means at HTTP.SYS. HTTP.SYS has been identified the name of the application pool where to send. Now, let’s see how this request moves from HTTP.SYS to Application Pool.

In User Level of IIS, we have Web Admin Services (WAS) which takes the request from HTTP.SYS and pass it to the respective application pool.

When Application pool receives the request, it just passes the request to worker process (w3wp.exe). The worker process “w3wp.exe” looks up the URL of the request to load the correct ISAPI extension. ISAPI extensions are the IIS way to handle requests for different resources. Once ASP.NET is installed, it installs its own ISAPI extension (aspnet_isapi.dll) and adds the mapping into IIS.
Note: Sometimes if we install IIS after installing asp.net, we need to register the extension with IIS using an aspnet_regiis command.

When Worker process loads the aspnet_isapi.dll, it starts an HTTPRuntime, which is the entry point of an application. HTTPRuntime is a class which calls the ProcessRequest method to start Processing.

When this method called, a new instance of HTTPContext is created.  Which is accessible using HTTPContext.Current  Properties. This object remains alive during the life time of object request.  Using HttpContext.Current we can access some other objects like Request, Response, Session, etc.

After that HttpRuntime load, an HttpApplication object with the help of  HttpApplicationFactory class. Every request should pass through the corresponding HTTPModule to reach to HTTPHandler, this list of a module is configured by the HTTPApplication.
Now, the concept comes called “HTTPPipeline.” It is called a pipeline because it contains a set of HttpModules ( For Both Web.config and Machine.config level) that intercept the request on its way to the HttpHandler. HTTPModules are classes that have access to the incoming request. We can also create our HTTPModule if we need to handle anything during upcoming request and response.

HTTP Handlers are the endpoints in the HTTP pipeline. All request that is passing through the HTTPModule should reach to HTTPHandler.  The  HTTP Handler generates the output for the requested resource. So, when we were requesting for any aspx web pages,   it returns the corresponding HTML output.
All the request now passes from httpModule to respective HTTPHandler then the method and the ASP.NET Page life cycle starts.  This ends the IIS Request processing and starts the ASP.NET Page Lifecycle.

Conclusion

When the client request for some information from a web server, request first reaches to HTTP.SYS of IIS. HTTP.SYS then send the request to particular  Application Pool. Application Pool then forwards the request to worker process to load the ISAPI Extension which will create an HTTPRuntime Object to Process the request via HTTPModule and HTTP handler. After that, the ASP.NET Page LifeCycle events start.
This was a just overview of IIS Request Processing to let Beginner’s know how the request gets processed in the backend.  If you want to learn about details, please check the link for Reference and Further Study section.

Reference and Further Study

A low-level Look at the ASP.NET Architecture
IIS Architecture

Please share your suggestion and feedback.

Filter GridView Records using AJAX Slider Control

Sometimes we need to filter the gridview data based on some range value. On that case we can use AJAX Slider control to provide scrollable Filter functionality with gridview control. Data source for the Gridview can be anything like XML or Database.

You can read the complete article and Implementation and download the sample application  from DotNetFunda.Com

I will also write one article on AJAX MulipleSlider to filter the data based on minimumn and maximum value.

Please share your valuable feedback and suggestion.

Visual Studio 2010 – Extension (VSX) Contest Winner – From CodeProject

My ZoomSlider VSX Extension  has been selected as a prize winner for  Visual Studio 2010 Extension Contest for the category “Most Useful Extension”!

As a prize I have Won an Microsoft Zune HD With a touchscreen, HD Radio™, and HD video out (Zune® HD AV dock required), the new Zune® HD is the best Zune® yet.!


You can also find the article in MSDN Visual Studio Gallery

Thanks to all of  you .


ASP.NET 4.0 Features – MetaDescription and MetaKeywords

ASP.NET 4.0, came up with two new properties inside Page Class, those are MetaDescription and MetaKeyWord. This has been introduce because of make web application Search Engine Friendly. Search Engine looks for Meta tag of our web page to get the details of page contents. In ASP.NET 4.0, we can add these two properties with Page class in Code behind or in Page Directives.
If you want to find out the definition of these two properties, Right Click on Page Class and Click on Goto Definition. This will show you the Meta data information of Page Class as shown in below picture

If we set MetaDescription and MetaKeywords either from Code behind or using Page Directive in aspx page, both will be render as “meta” tag in html code.
The main objective of MetaKeywords and MetaDescription proerties to make your web application SEO friendly. In ASP.NET 2.0, HtmlMeta used to do the same, but in ASP.NET 4.0 make these thing  very simple as we can easily add using Page Class.

You can find the Complete Article over,  DotNetFunda.com

It has alreday been shared with

www.dotnetkicks.com

dotnetshoutout.com

delicious.com

digg.com

You can also follow me @ http://twitter.com/AbhijitJana