在.NET Core 1.1应用程序中加载.Net Framework类型

时间:2017-03-24 14:26:10

标签: asp.net-web-api asp.net-core visual-studio-2017

使用Visual Studio 2017,我创建了一个ASP.NET核心Web应用程序(.NET Framework)。安装了NuGets for .NET Framework 4.5.2依赖项,构建并将应用程序发布到我安装了.NET Core 1.1.1 RunTime的Windows Server框中。我运行我的应用程序并获得以下内容:

PS C:\Performance_App\v.0.0.1> .\EPiServer.Social.Testing.Performance.Application
Hosting environment: Development
Content root path: C:\Performance_App\v.0.0.1
Now listening on: http://*:5000
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 POST http://socialvm2.ep.se:5000/api/comments multipart/form-data; boundary=----WebKitFormBoundarycVrgT9gRbDmTFv78 946
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
      Executed action EPiServer.Social.Testing.Performance.Application.Controllers.CommentsController.Post (EPiServer.Social.Testing.Performance.Application) in 168.0949ms
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HL3IML91HVGN": An unhandled exception was thrown by the application.
System.TypeLoadException: Could not load type 'EPiServer.Social.Common.Rest.ResponseMessageHandler' from assembly 'EPiServer.Social.Common.Rest, Version=1.2.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.
   at EPiServer.Social.Comments.Rest.HttpCommentRepository..ctor(IHttpClientFactory httpClientFactory, ICommentRequestFactory requestFactory)
   at EPiServer.Social.Comments.DefaultCommentServiceFactory.GetRepository()
   at EPiServer.Social.Comments.DefaultCommentServiceFactory.Create()
   at EPiServer.Social.Testing.Performance.Application.Controllers.CommentsController..ctor()
   at lambda_method(Closure , IServiceProvider , Object[] )
   at Microsoft.AspNetCore.Mvc.Internal.TypeActivatorCache.CreateInstance[TInstance](IServiceProvider serviceProvider, Type implementationType)
   at Microsoft.AspNetCore.Mvc.Controllers.DefaultControllerActivator.Create(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Controllers.DefaultControllerFactory.CreateController(ControllerContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextResourceFilter>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---

.NET Framework依赖关系树看起来不错:

enter image description here

关于这个特定问题可能有什么想法?

0 个答案:

没有答案