web.config conflicts for .NET 2.0 Web Service running under .NET 4.0 web site?

Locked web.config conflicts for .NET 2.0 Web Service running under .NET 4.0 web site?

  • Monday, April 16, 2012 3:13 PM
     
     

    I'm getting errors when I try to run my .NET 2.0 Web Services under a .NET 4.0 framework web site.  It appears to be some conflict/inheritance problem with having two web.configs.

    I've tried adding the element below to the root web config (for my .NET 4.0 web site)

    <location path="." inheritInChildApplications="false">

    But I get an  "attribute not allowed" ... should this setting be in the web.config for my .NET 2.0 web services?

    Or, am I just attempting to do something that is just not possible - run a .NET 2.0 web service under a .NET 4.0 web site?

    Thanks, Rob.

All Replies

  • Monday, April 16, 2012 3:43 PM
     
     

    Think I found the solution, I needed to add the .NET 2.0 namespace to my .NET 4.0 root web config (in addition to the inheritInChildApplications setting).

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

    My assumption is that my .NET 4.0 web site is still running under .NET 4.0 even with this configuration setting??  I hope that's the case as my web site appears to run correctly (as all the assemblies are .NET 4.0 and I have targetFramework="4.0".

    Rob

  • Tuesday, April 17, 2012 2:20 PM
     
     

    What version of .Net framework will be used for your web site will be decided by what version is mentioned in your Web Site PropertiesàAsp.net Tabà Asp.net Version Drop Down not from web.config where as for other application it is determined by <TargetFramework> attribute.

    If it is configured as 4.0, then Yes, NET 4.0 web site is still running under .NET 4.0 even with your configuration setting.

    .Net 2.0, 3.0, 3.5 uses .Net CLR 2.0 where as .Net 4.0 uses CLR 4.0. As i know The .NET Framework 4 is backward-compatible with applications that were built with the .NET Framework versions 1.1, 2.0, 3.0, and 3.5. In other words, applications and components built with previous versions of the .NET Framework will work on the .NET Framework 4 with CLR 4.0

    Refer Version Compatibility in the .NET Framework


    Lingaraj Mishra