问题描述
提示信息如下ServerErrorin'/'Application.--------------------------------------------------------------------------------ConfigurationErrorDescription:Anerroroccurredduringtheprocessingofaconfigurationfilerequiredtoservicethisrequest.Pleasereviewthespecificerrordetailsbelowandmodifyyourconfigurationfileappropriately.ParserErrorMessage:The'targetFramework'attributeinthe<compilation>elementoftheWeb.configfileisusedonlytotargetversion4.0andlaterofthe.NETFramework(forexample,'<compilationtargetFramework="4.0">').The'targetFramework'attributecurrentlyreferencesaversionthatislaterthantheinstalledversionofthe.NETFramework.Specifyavalidtargetversionofthe.NETFramework,orinstalltherequiredversionofthe.NETFramework.SourceError:Line21:-->Line22:<system.web>Line23:<compilationtargetFramework="4.5"/>Line24:<httpRuntime/>Line25:<pagescontrolRenderingCompatibilityVersion="3.5"clientIDMode="AutoID">SourceFile:E:KnowLedgePublicweb.configLine:23--------------------------------------------------------------------------------VersionInformation:Microsoft.NETFrameworkVersion:4.0.30319;ASP.NETVersion:4.0.30319.1我把.netframwork版本改成4.0以后也报错提示如下ServerErrorin'/'Application.--------------------------------------------------------------------------------Theassembly'System.Web.Extensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'doesnotcontainaWebresourcethathasthename'MsAjaxBundle'.Makesurethattheresourcenameisspelledcorrectly.MakesurethattheapplicationreferencesthecorrectversionofanASP.NETAJAXFrameworkassembly.Description:Anunhandledexceptionoccurredduringtheexecutionofthecurrentwebrequest.Pleasereviewthestacktraceformoreinformationabouttheerrorandwhereitoriginatedinthecode.ExceptionDetails:System.InvalidOperationException:Theassembly'System.Web.Extensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'doesnotcontainaWebresourcethathasthename'MsAjaxBundle'.Makesurethattheresourcenameisspelledcorrectly.MakesurethattheapplicationreferencesthecorrectversionofanASP.NETAJAXFrameworkassembly.SourceError:Anunhandledexceptionwasgeneratedduringtheexecutionofthecurrentwebrequest.Informationregardingtheoriginandlocationoftheexceptioncanbeidentifiedusingtheexceptionstacktracebelow.StackTrace:[InvalidOperationException:Theassembly'System.Web.Extensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'doesnotcontainaWebresourcethathasthename'MsAjaxBundle'.Makesurethattheresourcenameisspelledcorrectly.MakesurethattheapplicationreferencesthecorrectversionofanASP.NETAJAXFrameworkassembly.]System.Web.UI.WebResourceUtil.VerifyAssemblyContainsReleaseWebResource(Assemblyassembly,StringreleaseResourceName,AssemblycurrentAjaxAssembly)+463970System.Web.UI.ScriptReference.ShouldUseDebugScript(StringreleaseName,Assemblyassembly,BooleanisDebuggingEnabled,AssemblycurrentAjaxAssembly)+86System.Web.UI.ScriptReference.DetermineResourceNameAndAssembly(ScriptManagerscriptManager,BooleanisDebuggingEnabled,String&resourceName,Assembly&assembly)+99System.Web.UI.ScriptReference.GetUrlFromName(ScriptManagerscriptManager,IControlscriptManagerControl,Booleanzip)+103System.Web.UI.ScriptReference.GetUrlInternal(ScriptManagerscriptManager,Booleanzip)+613System.Web.UI.ScriptReference.GetUrl(ScriptManagerscriptManager,Booleanzip)+213System.Web.UI.ScriptManager.RegisterUniqueScripts(List`1uniqueScripts)+202System.Web.UI.ScriptManager.RegisterScripts()+444System.Web.UI.ScriptManager.OnPagePreRenderComplete(Objectsender,EventArgse)+122System.Web.UI.Page.OnPreRenderComplete(EventArgse)+8872170System.Web.UI.Page.ProcessRequestMain(BooleanincludeStagesBeforeAsyncPoint,BooleanincludeStagesAfterAsyncPoint)+2716--------------------------------------------------------------------------------VersionInformation:Microsoft.NETFrameworkVersion:4.0.30319;ASP.NETVersion:4.0.30319.1
解决方案
解决方案二:
引用楼主chen110210的回复:
提示信息如下ServerErrorin'/'Application.--------------------------------------------------------------------------------ConfigurationErrorDescription:Anerroroccurredduringtheprocessingofaconfigurationfilerequiredtoservicethisrequest.Pleasereviewthespecificerrordetailsbelowandmodifyyourconfigurationfileappropriately.ParserErrorMessage:The'targetFramework'attributeinthe<compilation>elementoftheWeb.configfileisusedonlytotargetversion4.0andlaterofthe.NETFramework(forexample,'<compilationtargetFramework="4.0">').The'targetFramework'attributecurrentlyreferencesaversionthatislaterthantheinstalledversionofthe.NETFramework.Specifyavalidtargetversionofthe.NETFramework,orinstalltherequiredversionofthe.NETFramework.SourceError:Line21:-->Line22:<system.web>Line23:<compilationtargetFramework="4.5"/>Line24:<httpRuntime/>Line25:<pagescontrolRenderingCompatibilityVersion="3.5"clientIDMode="AutoID">SourceFile:E:KnowLedgePublicweb.configLine:23--------------------------------------------------------------------------------VersionInformation:Microsoft.NETFrameworkVersion:4.0.30319;ASP.NETVersion:4.0.30319.1我把.netframwork版本改成4.0以后也报错提示如下ServerErrorin'/'Application.--------------------------------------------------------------------------------Theassembly'System.Web.Extensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'doesnotcontainaWebresourcethathasthename'MsAjaxBundle'.Makesurethattheresourcenameisspelledcorrectly.MakesurethattheapplicationreferencesthecorrectversionofanASP.NETAJAXFrameworkassembly.Description:Anunhandledexceptionoccurredduringtheexecutionofthecurrentwebrequest.Pleasereviewthestacktraceformoreinformationabouttheerrorandwhereitoriginatedinthecode.ExceptionDetails:System.InvalidOperationException:Theassembly'System.Web.Extensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'doesnotcontainaWebresourcethathasthename'MsAjaxBundle'.Makesurethattheresourcenameisspelledcorrectly.MakesurethattheapplicationreferencesthecorrectversionofanASP.NETAJAXFrameworkassembly.SourceError:Anunhandledexceptionwasgeneratedduringtheexecutionofthecurrentwebrequest.Informationregardingtheoriginandlocationoftheexceptioncanbeidentifiedusingtheexceptionstacktracebelow.StackTrace:[InvalidOperationException:Theassembly'System.Web.Extensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'doesnotcontainaWebresourcethathasthename'MsAjaxBundle'.Makesurethattheresourcenameisspelledcorrectly.MakesurethattheapplicationreferencesthecorrectversionofanASP.NETAJAXFrameworkassembly.]System.Web.UI.WebResourceUtil.VerifyAssemblyContainsReleaseWebResource(Assemblyassembly,StringreleaseResourceName,AssemblycurrentAjaxAssembly)+463970System.Web.UI.ScriptReference.ShouldUseDebugScript(StringreleaseName,Assemblyassembly,BooleanisDebuggingEnabled,AssemblycurrentAjaxAssembly)+86System.Web.UI.ScriptReference.DetermineResourceNameAndAssembly(ScriptManagerscriptManager,BooleanisDebuggingEnabled,String&resourceName,Assembly&assembly)+99System.Web.UI.ScriptReference.GetUrlFromName(ScriptManagerscriptManager,IControlscriptManagerControl,Booleanzip)+103System.Web.UI.ScriptReference.GetUrlInternal(ScriptManagerscriptManager,Booleanzip)+613System.Web.UI.ScriptReference.GetUrl(ScriptManagerscriptManager,Booleanzip)+213System.Web.UI.ScriptManager.RegisterUniqueScripts(List`1uniqueScripts)+202System.Web.UI.ScriptManager.RegisterScripts()+444System.Web.UI.ScriptManager.OnPagePreRenderComplete(Objectsender,EventArgse)+122System.Web.UI.Page.OnPreRenderComplete(EventArgse)+8872170System.Web.UI.Page.ProcessRequestMain(BooleanincludeStagesBeforeAsyncPoint,BooleanincludeStagesAfterAsyncPoint)+2716--------------------------------------------------------------------------------VersionInformation:Microsoft.NETFrameworkVersion:4.0.30319;ASP.NETVersion:4.0.30319.1
<compilationtargetFramework="4.5"/>很明显你开发的web版本是.netframwork4.5你改成4.0当然报错了
解决方案三:
vs2012默认是4.5版本楼主把框架改成4.0就可以发布了但是不知道楼主有没有用到4.5里面特有的功能没有的话就改成4.0吧4.5感觉不怎么稳定前几个月用vs2012创建4.5的项目还出问题
解决方案四:
但是我用4.5的时候也报一个错误啊?
解决方案五:
four_year我用4.0的时候报的那个错误你遇到过吗?能不能给指点一下!!!
解决方案六:
IIS没有正确的注册.net。或则你的应用程序池没有选择正确的版本。
解决方案七:
请问楼主这个问题解决了吗,我比你还悲催,用vs2012,然后被告诉要在2003部署...如果你的问题解决了,请务必回复下我,万分感谢
解决方案八:
补充下;在2003下已经装了.netv4.0.30319的版本,应用程序池也单独建了4.0的
解决方案九:
服务器上装4.5,然后重新注册到iis