Skip to content

System.TypeLoadException: Could not load type 'Microsoft.AspNet.Builder.RequestDelegate' from assembly 'Microsoft.AspNet.Http.Abstractions' #1138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yuezhongxin opened this issue Nov 30, 2015 · 3 comments

Comments

@yuezhongxin
Copy link

Exception message:

2015-11-30 11:52:26.384 +08:00 [Error] Application startup exception
System.TypeLoadException: Could not load type 'Microsoft.AspNet.Builder.RequestDelegate' from assembly 'Microsoft.AspNet.Http.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
   at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Signature..ctor(IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy()
   at System.Reflection.RuntimeConstructorInfo.GetParameters()
   at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher..ctor(ConstructorInfo constructor)
   at Microsoft.Extensions.Internal.ActivatorUtilities.<>c.<CreateInstance>b__1_1(ConstructorInfo constructor)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
   at Microsoft.AspNet.Builder.UseMiddlewareExtensions.<>c__DisplayClass2_0.<UseMiddleware>b__0(RequestDelegate next)
   at Microsoft.AspNet.Builder.Internal.ApplicationBuilder.Build()
   at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication()

project.json:

{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "EntityFramework.Core": "7.0.0-rc2-16432",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc2-15933",
    "Microsoft.AspNet.Mvc": "6.0.0-rc2-16498",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc2-16088",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
    "Serilog.Framework.Logging": "1.0.0-*"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel"
  },

  "frameworks": {
    "dnx451": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules"
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ]
}
@yuezhongxin yuezhongxin changed the title System.TypeLoadException: Could not load type 'Microsoft.AspNet.Builder.RequestDelegate' from assembly 'Microsoft.AspNet.Http.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' System.TypeLoadException: Could not load type 'Microsoft.AspNet.Builder.RequestDelegate' from assembly 'Microsoft.AspNet.Http.Abstractions' Nov 30, 2015
@Eilon
Copy link
Contributor

Eilon commented Nov 30, 2015

You can't mix RC1 and RC2 dependencies. Pick one or the other.

@yuezhongxin
Copy link
Author

@Eilon Thank you, I modified project.json file, it works.

{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc2-15933",
    "Microsoft.AspNet.Mvc": "6.0.0-rc2-16498",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc2-16088",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc2-15977",
    "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc2-15866",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-15866",
    "Microsoft.Extensions.Logging": "1.0.0-rc2-15866",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-15867",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-15867",
    "Serilog.Framework.Logging": "1.0.0-*"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel"
  },

  "frameworks": {
    "dnx451": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules"
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ]
}

@HelloJesse
Copy link

@yuezhongxin that's why I received a email from 蟋蟀..... it's you!

natemcmaster pushed a commit that referenced this issue Nov 20, 2018
- Add the correlation id to the request scope as well as setting
it as the parent id of the activity
ryanbrandenburg pushed a commit that referenced this issue Nov 22, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants