Method not found: 'Void System.Web.UI.ScriptResourceDefinition

点点圈 提交于 2020-01-01 18:53:05

问题


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!


回答1:


The LoadSuccessExpression property is a new property in .NET 4.5. Since your host only supports .NET 4, this property does not exist when deployed.

You're getting a missing method exception since a property setter is really just a method behind the scenes.



来源:https://stackoverflow.com/questions/16739417/method-not-found-void-system-web-ui-scriptresourcedefinition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!