Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

 IIS Manager Error: The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

The above is the exception comes most of the times when you are using the default web site in windows 7. Automatically it will stop the site and when we try to start then the above exception is coming. Because of it, no web sites, applications are running and unable to proceed to any further step. I know that the default web site uses the port number 80 by default. For testing purposes I have changed the port number to 9999 and tried to start the default web site and surprisingly it started and everything running fine. So, I fixed to the problem that the issue is only because of the port 80. I came to conclusion that someone else other than IIS web site is using the port 80.

Now, we found the problem. We need to look for solution. But, how to know who are using the port 80 other than IIS?

 Here is the post on it. "How to find what process is using which port?". The helped me a lot to find out the problem in minutes.

So, by following the steps in above post, found that the Skype is the culprit. Don't know why Skype needed the port 80. Actually there is no need to use port 80 by Skype. But, it's weird. Only Skype team can know about this.

So, finally to resolve this problem:
  1. Open the task manager and kill skype process.
  2. Go to IIS, and then start the default web site on port 80.
  3. Do once IISRESET.
That's it. Everything should start working. Now, you can start Skype and use both. Enjoy.
Note: Make sure in this case it is Skype, tomorrow some other third party software. So, you should carefully read the post "How to find what process is using which port?" to resolve these kind of problems.
Hope you enjoyed it. Read More...

IIS 7 – Managed pipeline mode – Global.asax redirect not working

I installed Windows 7 and I really like it. I migrated all my applications from my old machine to new. And my old machine is running WS 2003 [iis 6] and new machine is Windows 7 [IIS 7]. In all applications everything ran successful except one. I implemented exception handling in my application. I have Global.asax page and in the Application_Error event, I log the exception details and redirecting the user to the error page. Whenever there is an exception in my application the page never redirect to the error page, it stays there in the same page with exception details on the screen.

The same code ran very successful on my old server and in Windows 7 it's not. I just started thinking what could be the issue. The analysis went in this way. Code not changed, DB not changed and the only part changed is the IIS. Windows 7 has IIS7. So, The problem would be either the isapi dll or the application pool. So, started researching on those and found interesting points.

In IIS 7, application pool has a separate feature named "Managed pipeline mode". This will tell the pool the pipeline mode. [which is of type sint32 in c# and the possible values for it are 0 and 1.]

  • 0 is managed pipeline runs in integration mode.
  • 1 is managed pipeline runs in classic or ISAPI mode. [IIS 6].

In Classic mode, managed application events are executed by using ISAPI. In Integrated mode, ASP.NET request processing integrates directly into the IIS 7 request-processing pipeline. Integrated mode enables you to configure managed modules for Web sites that are developed with unmanaged code.

So, to work your logic correct, go to your site and see under what application pool your site running. Now, go to that application pool, properties and change the pipeline mode to classic mode. Now, you see everything works fine and the page starts redirecting to error page when any exception in your application.

For more details: http://msdn.microsoft.com/en-us/library/microsoft.web.administration.managedpipelinemode.aspx

Hope this helps and new tip today. Do you like this post?

Read More...

MuteX could not be created error in ASP.NET

If you get error like MuteX could not be created then the problem is because of the so many versions of your site are in the temporary files. To fix it, do the following.
  1. If you have visual studio 2005 open, then close it
  2. Go to the ASP.NET temporary folder for v2.0 of the framework drive:\Windows\Microsoft.Net\Framework\v2.0\Temporary ASP.NET Files
  3. Remove the folder for your application. [If it is not deleting, then do IISRESET and delete it.]
  4. Reset IIS (on a command line window, >iisreset)
  5. Now, browse application(http://localhost/your app)
  6. Then reopen Visual studio, open your project in VS and build it.
  7. And it should work now.
All problems were resolved and no problems in running your applications. Hope this tip helped you out!!! Read More...

Register IIS with ASP.NEt framework

Some times we forget to install IIS before installing ASP.NET frame work. In these cases, we encounter different problems because of not registering IIS with ASP>NET frame work. Please follow below steps to register IIS.
  1. Open Command Prompt;
  2. Move to your (.net) version directory, like C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>
  3. type registerIIS exe file with option i and enable it. (For Windows2003 you must give enable option,For Windows2000/XP no need just option I is enough.)
Example: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis.exe -i –enable

Now just run IISRESET once to set everything correct. Read More...

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Go to IIS and check your virtual directory is configured as an application. If it is not converted as an application then create an application. Read More...

unrecognized configuration section 'connectionStrings'

If you get the error like unrecognized configuration section 'connectionStrings' in ASP.NET application then the reason behind is your application is not running under the ASP>NET version 2.0. It is running under the ASP.NET version 1.1.4322.
To change this, please follow the steps below.
  1. Go to IIS and select the folder Website
  2. Select Default Websites
  3. Right click on the default web sites
  4. Select properties and choose Asp.net tab
  5. Here select the ASP.NET version to 2.0
Note: To allow ASP.NET version 2.0 you need to do this. In IIS, Web service Extensions allow Asp.net v2.0.50727. Read More...
Related Posts with Thumbnails
GiF Pictures, Images and Photos