How to host an ASP.NET Web Applications site on IIS 7

19,426

Solution 1

The error will be probably because of, you developed the site in .net version 2.0 and try to run under the Integrated pipeline apppool that runs under .net framework 4.0.

SoL:

  1. Create a new apppool with classic mode and .net framework equals to your application developed framework.

  2. attach the newly created apppool to your virtual directory.

Note: For deployment, you don need to copy .csproj or unwanted solution files to destination location.

If it is otherway around, (i.e,) application is .net 4.0 and apppool is 2.0 please follow the below steps.

  1. Update .net framework in the server to 4.0 if you have only 2.0.
  2. Then register .net 4.0 version in IIS by running the following command in command prompt.

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i

Solution 2

Try changing Application pool to Classic. To do that open Advanced settings of your application in IIS manager and change Application Pool. There should be "ASP.NET v4.0 Classic" or something similar according to your framework version.

http://technet.microsoft.com/en-us/library/cc731755(v=ws.10).aspx

Share:
19,426
Vivendi
Author by

Vivendi

Updated on June 04, 2022

Comments

  • Vivendi
    Vivendi almost 2 years

    I'm locally working on an ASP.NET Web Applications site. It's almost finished so i wanted to try and put it in an IIS server.

    The IIS server is running on a different server. What do i need to do to run my ASP.NET web site in that remote IIS server?

    I tried to following:

    I copied my entire project directory (so including the .csproj file, the bin folder etc.) to the following location on the remote server, where IIS is running C:\MyProject.

    In IIS manager i added a Virtual Directory under Default Web Site. Located my Web Site files in C:\MyProject and added that folder. Then in IIS manager i converted that Virtual Directory to an Application.

    But when i browse to my Web Site i get an error:

    HTTP Error 500.23 - Internal Server Error

    An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

    So this is probably not the way to do it. I don't think i can just do a Deploy, because i never set up any .axd(?) or anything.

    So my question is, what do i have to do in order to run my Web Site on IIS..?

  • Vivendi
    Vivendi about 11 years
    It seems to be the other way around. My Web Site is developed in .NET 4.0, but the DefaultAppPool is set to .NET Framework Version v2.0. I can't change that version to .NET 4.0. Is that normal or should i update the server with a newer .NET version?
  • Vivendi
    Vivendi about 11 years
    I see the Classic .NET AppPool. But that is set to .NET Framework Version 2.0. Does that mean i have to update the server with a newer version of .NET? Because i can't select any other version from the dropdown list other than v2.0 or No Managed Code.
  • fofik
    fofik about 11 years
    you should install .NET Framework 4.0 as you use in development. If you have installed .NET 4 already, you need to run aspnet_regiis.exe with -i option. link
  • Monie corleone
    Monie corleone about 11 years
    does your server have .net version 4.0?