在IIS 6上的3.5 Web应用程序下运行.net 4 Web应用程序作为虚拟目录

时间:2011-07-22 18:57:05

标签: asp.net .net-3.5 .net-4.0 iis-6 virtual-directory

我在IIS6上运行.Net 3.5 webapp。我现在有一个.Net4 webapp,我需要在3.5主webapp下作为虚拟目录运行。

我创建了一个4.0应用程序池,创建了虚拟目录并将应用程序设置为使用4.0应用程序池。 4.0 webapp拥有自己的web.config,它位于虚拟目录中。

我收到此错误:

The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the <compilation> element of the Web.config file.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the <compilation> element of the Web.config file.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ConfigurationErrorsException: The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the <compilation> element of the Web.config file.]


System.Web.Compilation.MultiTargetingUtil.ValidateCompilerVersionFor40AndAbove(String compilerVersion) +235
System.Web.Compilation.MultiTargetingUtil.ValidateCompilerVersionFor40AndAbove() +76
System.Web.Compilation.MultiTargetingUtil.InitializeTargetFrameworkName() +101
System.Web.Compilation.MultiTargetingUtil.EnsureFrameworkNamesInitialized() +149
System.Web.Compilation.BuildManager.Initialize() +204
System.Web.Compilation.BuildManager.InitializeBuildManager() +246
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +350

[HttpException (0x80004005): The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the <compilation> element of the Web.config file.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9013676
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

在我的4.0 web.config中,编译器版本IS设置为4.0。

0 个答案:

没有答案
相关问题