将.NET应用程序部署到生产环境时找不到异常的方法

时间:2013-08-07 20:50:59

标签: .net missingmethodexception

我最初使用.NET 4.5创建了一个.NET应用程序但是当我意识到我的服务器只有4.0时,我通过转到项目的属性页选项将应用程序恢复为4.0,单击构建选项卡然后选择.NET框架4.0作为目标框架。现在该应用程序在this帖子中解释,但在服务器上没有。因此,似乎.NET 4.5的某些方面在被调用的项目中遗留下来并导致应用程序崩溃。我得到的堆栈跟踪是:

[MissingMethodException: Method not found: 'Void System.Web.UI.ScriptResourceDefinition.set_LoadSuccessExpression(System.String)'.]
   Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode.Start() +0

[InvalidOperationException: The pre-application start initialization method Start on type Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode threw an exception with the following error message: Method not found: 'Void System.Web.UI.ScriptResourceDefinition.set_LoadSuccessExpression(System.String)'..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +11802638
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +465
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1167

[HttpException (0x80004005): The pre-application start initialization method Start on type Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode threw an exception with the following error message: Method not found: 'Void System.Web.UI.ScriptResourceDefinition.set_LoadSuccessExpression(System.String)'..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11791440
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4928277

有谁知道如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

上传时出错。 :)