aspnet / Mvc

[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
5.62k stars 2.14k forks source link

app.UseBrowserLink causes MissingMethodException #3148

Closed damccull closed 9 years ago

damccull commented 9 years ago

Using the latest nightlies + latest dnvm/dnx, with app.UseBrowserLink() in my Startup.Configure() method, I'm getting the following exception. Commenting out that one line immediately brings the page back to a normal state.

System.MissingMethodException: Method not found: 'Void Microsoft.AspNet.Http.HttpContext.SetFeature(!!0)'.
   at Microsoft.VisualStudio.Web.BrowserLink.Runtime.BrowserLinkMiddleware.AddPageExecutionListenerFeatureTo(HttpContext context, String requestId)
   at Microsoft.VisualStudio.Web.BrowserLink.Runtime.BrowserLinkMiddleware.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at NWebsec.Owin.Middleware.MiddlewareBase.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at NWebsec.Owin.Middleware.MiddlewareBase.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at NWebsec.Owin.Middleware.MiddlewareBase.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at NWebsec.Owin.Middleware.MiddlewareBase.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Owin.WebSocketAcceptAdapter.<>c__DisplayClass6_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Hosting.Internal.RequestServicesContainerMiddleware.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Hosting.Internal.HostingEngine.<>c__DisplayClass29_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Loader.IIS.RuntimeHttpApplication.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNet.Loader.IIS.RuntimeHttpApplication.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.AspNet.Loader.IIS.HttpApplicationBase.d__9.MoveNext()

Here is my package.json:

{
    "webroot": "wwwroot",
    "userSecretsId": "redacted",
    "version": "1.0.0-*",

    "dependencies": {
        "AspNet.Security.OpenIdConnect.Server": "1.0.0-*",
        "EntityFramework.Commands": "7.0.0-beta8-*",
        "EntityFramework.SqlServer": "7.0.0-beta8-*",
        "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta8-*",
        "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta8-*",
        "Microsoft.AspNet.Authentication.Google": "1.0.0-beta8-*",
        "Microsoft.AspNet.Authentication.JwtBearer": "1.0.0-beta8-*", 
        "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta8-*",
        "Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-beta8-15642",
        "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta8-*",
        "Microsoft.AspNet.Diagnostics": "1.0.0-beta8-*",
        "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta8-*",
        "Microsoft.AspNet.Identity": "3.0.0-beta8-*",
        "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta8-*",
        "Microsoft.AspNet.Mvc": "6.0.0-beta8-*",
        "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta8-*",
        "Microsoft.AspNet.Server.IIS": "1.0.0-beta8-*",
        "Microsoft.AspNet.Server.WebListener": "1.0.0-beta8-*",
        "Microsoft.AspNet.StaticFiles": "1.0.0-beta8-*",
        "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta8-*",
        "Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta8-*",
        "Microsoft.Framework.Configuration.Json": "1.0.0-beta8-*",
        "Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta8-*",
        "Microsoft.Framework.Logging": "1.0.0-beta8-*",
        "Microsoft.Framework.Logging.Console": "1.0.0-beta8-*",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta8-*",
        "NodaTime": "2.0.0-alpha20150728"
    },

    "commands": {
        "web": "Microsoft.AspNet.Hosting --config hosting.ini",
        "ef": "EntityFramework.Commands"
    },

    "frameworks": {
        "dnx451": {
            "dependencies": {
                "Microsoft.AspNet.Owin": "1.0.0-beta8-*",
                "Microsoft.Owin": "3.0.1",
                "NWebsec.Owin": "2.1.1"
            }
        },
        "dnxcore50": { }
    },

    "exclude": [
        "wwwroot",
        "node_modules",
        "bower_components"
    ],
    "publishExclude": [
        "node_modules",
        "bower_components",
        "**.xproj",
        "**.user",
        "**.vspscc"
    ],
    "scripts": {
        "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
    }
}
pranavkm commented 9 years ago

cc @jodavis

Eilon commented 9 years ago

@jodavis is the issue here that the load is up-to-date, but the loader is loading an older BrowserLink runtime DLL?

jodavis commented 9 years ago

Yes, the runtime DLL that's installed with VS must be out of date. There should be a new tools build available soon, which will address the problem. In the meantime, app.UseBrowserLink() needs to be commented out.