简体   繁体   中英

Moving from IIS6 .net 2.0 (win2k3) to IIS7.5 .net 4.0 (win2k8) --> how to handle web.config assembly V=2.0.0.0

ASP.net websites : Were moving from IIS6 .net 2.0 (win2k3) to IIS7.5 .net 4.0 (win2k8) -

We have the following assembly entries in the different applications:

            <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>         
            <add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

Now the new Win2k8 IIS7.5 (sites set to .net FW 4.0) machine works with the assemblies as is (everything is 2.0.0.0. ), but is the the correct way?

Q1. Should I change all the

Version=2.0.0.0

to

Version=4.0.0.0

and test the system again?

Q2. Is it as easy as changing the Version , what about the PublicKeyToken? Does the PublicKeyToken change between Version 2.0.0.0 and Version 4.0.0.0? If so, do I go look up each one online to get the new PublicKeyToken?

Thank you

If the application is working fine do not touch it. That is the first rule of problem solving flowchart :)

You could get into trouble if you would change the versions. Your application was compiled with .NET 2.0 and without a full code analysis of changes between .NET 2.0 classes/methods and .NET 4.0 classes/methods you can not be sure what would it do (ie some might be deprecated or gone entirely).

As far as I know win2k8 has .NET 2.0 installed so the assemblies should be there. It would be a different matter if you would deploy to windows 2012 which by default has only .NET 4.x installed. Then it probably would not work.

As for the PublicKeyToken it should be the same for .NET 2.0 or .NET 4.0 as long as Microsoft uses the same key to strongly name the assemblies and the name of the assembly does not change (well that would be a different assembly with different PublicKeyToken).

But you still have the option to make a .NET 2.0 pool on IIS 7.5 and let the application run in the environment it was developed for (well if we exclude iis version out).

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