3

在我创建的每个 Web 项目中,我都遇到了这个错误,有什么想法吗?

Server Error in '/' Application.

Method not found: 'Void System.Web.HttpApplication.RegisterModule(System.Type)'.

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.HttpApplication.RegisterModule(System.Type)'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[MissingMethodException: Method not found: 'Void System.Web.HttpApplication.RegisterModule(System.Type)'.]
   Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.SelectionMappingExecutionListenerModule.PreApplicationStart() +0
   Microsoft.VisualStudio.Web.PageInspector.Runtime.Startup.PreApplicationStart() +8

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +335
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   Microsoft.VisualStudio.Web.PageInspector.Loader.RuntimeLoader.LoadRuntime() +63
   Microsoft.VisualStudio.Web.PageInspector.Loader.RuntimeLoader.PreApplicationStart() +18

[InvalidOperationException: The pre-application start initialization method PreApplicationStart on type Microsoft.VisualStudio.Web.PageInspector.Loader.RuntimeLoader threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +408
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +303
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +693

[HttpException (0x80004005): The pre-application start initialization method PreApplicationStart on type Microsoft.VisualStudio.Web.PageInspector.Loader.RuntimeLoader threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +637
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +256

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1008

(对不起,我必须写点别的东西,否则堆栈溢出不要让我发布问题)(一次又一次)

4

2 回答 2

0

这已在 MonoFramework MDK v4.2.0 (bug #21810 ) 和 v4.3.2 (bug #33809 ) 中修复。

在 ASP.Net MVC5 中,System.HttpApplication.RegisterModule()已在 Mono Framework v5.4.0.203 中添加(根据此提交)。

于 2017-10-05T09:42:00.683 回答
0

机器上安装的 Moles 与框架 v4.5 冲突,安装一些 VS 更新可能是导致此问题的原因。

解决方案是使用.NET Framework Cleanup Tool删除框架 4.5 组件,然后运行 ​​VS 还原。

相关:Page Inspector 导致多次调用HttpApplication:Application_Start

资料来源:@Paolo 的评论

于 2017-10-05T09:47:40.537 回答