vb.net 找不到方法:'Void System.Web.UI.ScriptResourceDefinition
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16739417/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Method not found: 'Void System.Web.UI.ScriptResourceDefinition
提问by BustedSanta
I've built a fairly simple website in using Visual Studio 2012 using .net 4.5 version.
我使用 .net 4.5 版本使用 Visual Studio 2012 构建了一个相当简单的网站。
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)'.
找不到方法:'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.
说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
Exception Details: System.MissingMethodException: Method not found: 'Void System.Web.UI.ScriptResourceDefinition.set_LoadSuccessExpression(System.String)'.
异常详细信息:System.MissingMethodException:找不到方法:'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
[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
[InvalidOperationException: 预应用程序启动初始化方法 Start on type Microsoft.ScriptManager.WebFormsv45.PreApplicationStartCode 引发异常并显示以下错误消息:未找到方法:'Void System.Web.UI.ScriptResourceDefinition.set_LoadSuccessExpression(System.String)' ..] System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 方法) +423 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory、HostingEnvironmentParameters、HostingParameters、PolicyLevel policyLevel、异常 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
[HttpException (0x80004005): 预应用程序启动初始化方法 Start on type Microsoft.ScriptManager.WebFormsv45.PreApplicationStartCode 引发异常并显示以下错误消息:方法未找到:'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)
(托管公司提供以下内容:Microsoft .NET Framework 版本:4.0.30319;ASP.NET 版本:4.0.30319.272)
I am aware of this question/answer: http://forums.asp.net/t/1823969.aspx/1But 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).
我知道这个问题/答案:http: //forums.asp.net/t/1823969.aspx/1但我发现它不是很有帮助,因为它没有提供任何关于我在哪里更正参考文献的细节(我不确定 csproj 在哪里/什么)。
Also I am aware of the similar question posted here with no answers:
我也知道这里发布的类似问题没有答案:
找不到方法:'Void System.Web.UI.ScriptResourceDefinition.set_LoadSuccessExpression(System.String)'
Any tips and suggestions how to fix this issue are appreciated.
任何解决此问题的提示和建议表示赞赏。
Thank you!
谢谢!
回答by Reed Copsey
The LoadSuccessExpressionproperty is a new property in .NET 4.5. Since your host only supports .NET 4, this property does not exist when deployed.
该LoadSuccessExpression属性是.NET 4.5的新特性。由于您的主机仅支持 .NET 4,因此部署时此属性不存在。
You're getting a missing method exception since a property setter is really just a method behind the scenes.
由于属性设置器实际上只是幕后的一个方法,因此您会收到一个缺失的方法异常。

