2

I've built a fairly simple website in using Visual Studio 2012 using .net 4.5 version.

When I uploaded the website to my server I get the following error:

Method not found: 'Void System.Web.UI.ScriptResourceDefinition.set_LoadSuccessExpression(System.String)'.

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.MissingMethodException: Method not found: 'Void System.Web.UI.ScriptResourceDefinition.set_LoadSuccessExpression(System.String)'.

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

[InvalidOperationException: The pre-application start initialization method Start on type Microsoft.ScriptManager.WebFormsv45.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) +423 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677

[HttpException (0x80004005): The pre-application start initialization method Start on type Microsoft.ScriptManager.WebFormsv45.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) +9090876 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256

(the hosting company provides the following: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272)

I am aware of this question/answer: http://forums.asp.net/t/1823969.aspx/1 But I find it wasn't very helpful since it doesn't provide any details about where I would correct the references (I am not sure where/what csproj is).

Also I am aware of the similar question posted here with no answers:

Method not found: 'Void System.Web.UI.ScriptResourceDefinition.set_LoadSuccessExpression(System.String)'

Any tips and suggestions how to fix this issue are appreciated.

Thank you!

4

1 回答 1

4

LoadSuccessExpression属性是 .NET 4.5 中的新属性由于您的主机仅支持 .NET 4,因此部署时此属性不存在。

由于属性设置器实际上只是幕后的一种方法,因此您会得到一个缺少的方法异常。

于 2013-05-24T16:18:11.877 回答