简体   繁体   中英

Framework 3.5 installed but 4.0 appears in IIS

I need to have .net fw 3.5 on my dev box. I installed dotnetfx35_sp1.exe. The only options in IIS Application Pool have to do with 4.0. How can I get 3.5 to appear? Thanks

When setting up an IIS Application Pool, you will only get 2 options for .NET Framework Version - v2.0 and v4.0 . This is because those are the versions of the CLR. .NET 3.0 and 3.5 were actually additions to the .NET 2.0 CLR. So you specify in IIS which version of the CLR you want to use, but you specify the version of the Framework you want to use in your web.config:

<compilation debug="false">
    <assemblies>
      <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies>
</compilation>

If you are using Framework version 2, 3, or 3.5, then you should specify v2.0 in your app pool.

Scott Hanselman has a more in depth explanation here

How to set an IIS Application or AppPool to use ASP.NET 3.5 rather than 2.0

If really only 4.0 shows up and there is no 2.0, then you possibly might need to register it with iis.

Open your console (cmd) as admin.

Then go to

%WindowsRootDirectory%\Microsoft.NET\Framework64\v2.0.50727

(or just "Framework" if you dont run 64bit Windows)

and run

aspnet_regiis -i

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM