2017-03-14 53 views
0

我是新来的.NetCore,目前正在使用几天前发布的Asp.NetCore 1.1构建Webapi应用程序。我引用了几个类库,它是在.net 4.5.2中开发的。System.IO.FileNotFoundException .NetCore 1.1

当我运行应用程序时,当我调用控制器时出现错误。请帮忙解决这个问题。

System.IO.FileNotFoundException:未能加载文件或程序 ”,版本= 1.0.0.0,文化=中性 公钥= 22b71681a01d2a47' 。系统找不到指定的文件 。文件名:”,版本= 1.0.0.0,文化=中立, 公钥= 22b71681a01d2a47' 在 System.Signature.GetSignature(void *的pCorSig,的Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle,IRuntimeMethodInfo methodHandle,RuntimeType declaringType)在 系统。 Signature..ctor(IRuntimeMethodInfo methodHandle,RuntimeType declaringType)处 System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy() System.Reflection.RuntimeConstructorInfo.get_Signature()处 Microsoft.Extensions System.Reflection.RuntimeConstructorInfo.GetParameters() .Internal.ActivatorUtilities.FindApplicableConstructor(类型 instanceType,Type [] argumentTypes,ConstructorIn FO & matchingConstructor,可空1[]& parameterMap) at Microsoft.Extensions.Internal.ActivatorUtilities.CreateFactory(Type instanceType, Type[] argumentTypes) at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateFactory(Type instanceType, Type[] argumentTypes) at System.Collections.Concurrent.ConcurrentDictionary 2.GetOrAdd(TKEY的 键,Func键2 valueFactory) at Microsoft.AspNetCore.Mvc.Internal.TypeActivatorCache.CreateInstance[TInstance](IServiceProvider serviceProvider, Type implementationType) 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 --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAsync>d__20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame 1.d__2.MoveNext()

+0

任何机会,你可以提供的最小的解决方案,使我们能够复制问题的代码? – Ignas

回答

0

当你建立你有一些所谓的.net standard一个* .NET的核心应用。这个.NET标准是所有.NET平台必须实现的一组API。这将统一.NET平台并防止未来的碎片化。

根据此表:

alt

在.NET Framework 4.5.2应与.NET Standard 1.2.NET Standard 1.3兼容。

如果任何此标准的作品尝试将您的dll的目标版本更改为.NET Framework 4.5.1.NET Framework 4.6

有关于一个有用的链接什么是NET标准:https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing-net-standard/

相关问题