Aws-lambda-dotnet: 测试工具:内部服务器错误:FileNotFoundException:无法加载文件或程序集

创建于 2020-03-06  ·  19评论  ·  资料来源: aws/aws-lambda-dotnet

似乎我遇到了一个我看不到其他人遇到的问题。 我已经检查了我能想到的所有内容,但无论我做什么,当 lambda 测试工具在浏览器中打开时,它都无法加载函数列表。

在网络选项卡中,我可以看到:

500 Error: http://localhost:5050/webtester-api/Tester/aws-lambda-tools-defaults.json
FileNotFoundException: Could not load file or assembly 'Amazon.Lambda.Serialization.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'. The system cannot find the file specified.

全栈跟踪:

System.IO.FileNotFoundException: Could not load file or assembly 'Amazon.Lambda.Serialization.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'. The system cannot find the file specified.

File name: 'Amazon.Lambda.Serialization.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
   at Amazon.Lambda.TestTool.Runtime.LocalLambdaRuntime.LoadLambdaFunction(LambdaFunctionInfo functionInfo) in C:\codebuild\tmp\output\src248644039\src\Tools\LambdaTestTool\Amazon.Lambda.TestTool\Runtime\LocalLambdaRuntime.cs:line 125
   at Amazon.Lambda.TestTool.Runtime.LocalLambdaRuntime.LoadLambdaFunctions(IList`1 configInfos) in C:\codebuild\tmp\output\src248644039\src\Tools\LambdaTestTool\Amazon.Lambda.TestTool\Runtime\LocalLambdaRuntime.cs:line 69
   at Amazon.Lambda.TestTool.WebTester.Controllers.TesterController.GetFunctions(String configFile) in C:\codebuild\tmp\output\src248644039\src\Tools\LambdaTestTool\Amazon.Lambda.TestTool\WebTester\Controllers\TesterController.cs:line 34
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at Amazon.Lambda.TestTool.WebTester.Startup.<Configure>b__6_0(HttpContext context, Func`1 next) in C:\codebuild\tmp\output\src248644039\src\Tools\LambdaTestTool\Amazon.Lambda.TestTool\WebTester\Startup.cs:line 97
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

有没有人遇到过这个问题或者可以指出我正确的方向? 我运行它时控制台中没有错误,我不完全确定哪里出错了。

可能值得一提的是我在 Ubuntu 上运行它。

Lambda-Test-Tool dependencies feature-request modullambda-test-tool

最有用的评论

@ericmilaneze您能否为我尝试并在您的 csproj 文件中添加值为true的属性CopyLocalLockFileAssemblies $ ,看看这是否会改变您的行为?

这是一个完整的 csproj 文件示例。

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
    <AWSProjectType>Lambda</AWSProjectType>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" />
    <PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="1.0.0" />
    <PackageReference Include="System.Data.SqlClient" Version="4.8.1" />
  </ItemGroup>
</Project>

所有19条评论

我正在开发这个工具的新版本,它与即将发布的 .NET Core 3.1 版本相关,但仍支持 .NET Core 2.1。 我一直在对 Lambda 代码的加载方式进行一些修改。 如果我提供了一个预览版本的链接,您是否愿意尝试一下。

@normj如果它向后兼容 2.1 肯定是因为我理想情况下还不想重做我的所有功能😅

是的,未来有两种不同的工具,一种用于 2.1,一种用于 3.1,但它们将共享很多相同的逻辑。 让我清理一下,然后我将添加一个指向 2.1 版本的链接。

赞赏 谢谢

这是即将发布的版本的预览版本的链接。

https://normj-packages.s3.us-west-2.amazonaws.com/Amazon.Lambda.TestTool-2.1.0.10.0-preview1.nupkg

要安装它,请下载 nupkg 文件。 然后在您下载文件的目录中运行以下命令来更新现有版本。

dotnet tool update -g amazon.lambda.testtool-2.1 --version 0.10.0-preview1 --add-source .

我们遇到了 0.9.5 无法加载 NuGet 包Microsoft.AspNet.WebApi.Client的 netstandard20 版本的问题。 更新到 0.10.0 预览版解决了我们的问题。

@brandon-king-halo 感谢您让我知道 0.10.0 预览版解决了这个问题!

抱歉,我还没有机会对此进行测试。 这周我应该可以看看它!

仅供参考,如果有人在本地安装nupkg时遇到问题。 跑:

dotnet tool uninstall -g amazon.lambda.testtool-2.1

然后运行:

dotnet tool install -g amazon.lambda.testtool-2.1 --version 0.10.0-preview1 --add-source .


@normj
对于预览版,我仍然遇到同样的异常:

System.IO.FileNotFoundException: Could not load file or assembly 'Amazon.Lambda.Serialization.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'. The system cannot find the file specified.

File name: 'Amazon.Lambda.Serialization.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604' ---> System.IO.FileNotFoundException: Could not load the specified file.
File name: 'Amazon.Lambda.Serialization.Json'
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
   at Amazon.Lambda.TestTool.Runtime.LocalLambdaRuntime.LoadLambdaFunction(LambdaFunctionInfo functionInfo) in C:\codebase\aws-lambda-dotnet\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\Runtime\LocalLambdaRuntime.cs:line 135
   at Amazon.Lambda.TestTool.Runtime.LocalLambdaRuntime.LoadLambdaFunctions(IList`1 configInfos) in C:\codebase\aws-lambda-dotnet\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\Runtime\LocalLambdaRuntime.cs:line 79
   at Amazon.Lambda.TestTool.WebTester.Controllers.TesterController.GetFunctions(String configFile) in C:\codebase\aws-lambda-dotnet\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool.WebTester21\Controllers\TesterController.cs:line 29
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at Amazon.Lambda.TestTool.WebTester.Startup.<Configure>b__6_0(HttpContext context, Func`1 next) in C:\codebase\aws-lambda-dotnet\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool.WebTester21\Startup.cs:line 95
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

您提到您在 Ubuntu 上执行此操作。 除了 Ubuntu 之外,您是否尝试过相同的解决方案? 想知道这是否是特定于平台的问题。

可能是相关的,尝试在 ubuntu 19.10 上使用 3.1 和相应的测试工具运行。

  1. dotnet new lambda.EmptyFunction --name LinuxFunction
  2. dotnet restore
  3. dotnet build
  4. dotnet lambda-test-tool-3.1 --no-ui

倾倒:

AWS .NET Core 3.1 Mock Lambda Test Tool (0.10.0)
Loaded local Lambda runtime from project output /home/k/Documents/tmp/LinuxFunction/src/LinuxFunction/bin/Debug/netcoreapp3.1
Executing Lambda function without web interface
Found Lambda config file /home/k/Documents/tmp/LinuxFunction/src/LinuxFunction/aws-lambda-tools-defaults.json
... Using config file /home/k/Documents/tmp/LinuxFunction/src/LinuxFunction/aws-lambda-tools-defaults.json
... Info: function handler LinuxFunction::LinuxFunction.Function::FunctionHandler is not defined in config file.
Unknown error occurred causing process exit: Could not load file or assembly 'Amazon.Lambda.Serialization.SystemTextJson, Version=0.0.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'. The system cannot find the file specified.

   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttribute(Assembly element, Type attributeType)
   at Amazon.Lambda.TestTool.Runtime.LocalLambdaRuntime.LoadLambdaFunction(LambdaFunctionInfo functionInfo) in C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\Runtime\LocalLambdaRuntime.cs:line 141
   at Amazon.Lambda.TestTool.LocalLambdaOptions.LoadLambdaFuntion(LambdaConfigInfo configInfo, String functionHandler) in C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\LocalLambdaOptions.cs:line 54
   at Amazon.Lambda.TestTool.TestToolStartup.LoadLambdaFunction(LambdaConfigInfo configInfo, LocalLambdaOptions localLambdaOptions, CommandLineOptions commandOptions, String lambdaAssemblyDirectory, String lambdaProjectDirectory, RunConfiguration runConfiguration) in C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\TestToolStartup.cs:line 263
   at Amazon.Lambda.TestTool.TestToolStartup.ExecuteWithNoUi(LocalLambdaOptions localLambdaOptions, CommandLineOptions commandOptions, String lambdaAssemblyDirectory, RunConfiguration runConfiguration) in C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\TestToolStartup.cs:line 131
   at Amazon.Lambda.TestTool.TestToolStartup.Startup(String productName, Action`2 uiStartup, String[] args, RunConfiguration runConfiguration) in C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\TestToolStartup.cs:line 82

(请注意,如果程序集引用(LambdaSerializer)被删除,它会“正常”运行,但显然这不是解决方案)

这事有进一步更新吗?

我正在使用带有 amazon.lambda.testtool-3.1 (0.10.0) 的 Fedora 31(所以它似乎不是@normj所假设的 Ubuntu 问题),我尝试了与@JoelRoxell相同的方法:

  1. dotnet new lambda.EmptyFunction --name LinuxFunction
  2. dotnet restore
  3. dotnet build
  4. dotnet lambda-test-tool-3.1 --no-ui

这是我得到的回应:

==============================================

AWS .NET Core 3.1 模拟 Lambda 测试工具 (0.10.0)
从项目输出 /home/eric/code/examples/ex005/LinuxFunction/src/LinuxFunction/bin/Debug/netcoreapp3.1 加载本地 Lambda 运行时
在没有 Web 界面的情况下执行 Lambda 函数
找到 Lambda 配置文件 /home/eric/code/examples/ex005/LinuxFunction/src/LinuxFunction/aws-lambda-tools-defaults.json
... 使用配置文件 /home/eric/code/examples/ex005/LinuxFunction/src/LinuxFunction/aws-lambda-tools-defaults.json
...信息:函数处理程序 LinuxFunction::LinuxFunction.Function::FunctionHandler 未在配置文件中定义。
发生导致进程退出的未知错误:无法加载文件或程序集“Amazon.Lambda.Serialization.SystemTextJson,版本=0.0.0.0,文化=中性,PublicKeyToken=885c28607f98e604”。 该系统找不到指定的文件。

在 System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule,RuntimeType 类型,IRuntimeMethodInfo pCtor,字节* ppBlob,字节pEndBlob,Int32* pcNamedArgs)
在 System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule 模块,RuntimeType 类型,IRuntimeMethodInfo ctor,IntPtr& blob,IntPtr blobEnd,Int32& namedArgs)
在 System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder 1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder 1 derivedAttributes)
在 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule 装饰模块,Int32 装饰元数据令牌,Int32 pcaCount,RuntimeType attributeFilterType)
在 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly 程序集,RuntimeType caType)
在 System.Reflection.RuntimeAssembly.GetCustomAttributes(类型属性类型,布尔继承)
在 System.Attribute.GetCustomAttributes(程序集元素,类型属性类型,布尔继承)
在 System.Attribute.GetCustomAttribute(程序集元素,类型属性类型,布尔继承)
在 System.Reflection.CustomAttributeExtensions.GetCustomAttribute(组件元素,类型 attributeType)
在 C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\Runtime\LocalLambdaRuntime.cs:line 141 中的 Amazon.Lambda.TestTool.Runtime.LocalLambdaRuntime.LoadLambdaFunction(LambdaFunctionInfo functionInfo)
在 C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\LocalLambdaOptions.cs:line 54 中的 Amazon.Lambda.TestTool.LocalLambdaOptions.LoadLambdaFuntion(LambdaConfigInfo configInfo, String functionHandler)
在 Amazon.Lambda.TestTool.TestToolStartup.LoadLambdaFunction(LambdaConfigInfo configInfo, LocalLambdaOptions localLambdaOptions, CommandLineOptions commandOptions, String lambdaAssemblyDirectory, String lambdaProjectDirectory, RunConfiguration runConfiguration) 在 C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon .Lambda.TestTool\TestToolStartup.cs:第 263 行
在 C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\TestToolStartup 中的 Amazon.Lambda.TestTool.TestToolStartup.ExecuteWithNoUi(LocalLambdaOptions localLambdaOptions, CommandLineOptions commandOptions, String lambdaAssemblyDirectory, RunConfiguration runConfiguration) .cs:第 131 行
在 C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda 中的 Amazon.Lambda.TestTool.TestToolStartup.Startup(String productName, Action`2 uiStartup, String[] args, RunConfiguration runConfiguration) .TestTool\TestToolStartup.cs:第 82 行

==============================================

正如@JoelRoxell提到的,如果我评论以下代码行,它就不会发生:
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.LambdaJsonSerializer))]

...但事实证明,我在一个真实的项目中尝试了同样的方法,它开始抱怨 Serilog:

System.IO.FileNotFoundException: Could not load file or assembly 'Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10'. The system cannot find the file specified.

听起来它没有找到任何依赖项。

有谁知道这里发生了什么?

@ericmilaneze您能否为我尝试并在您的 csproj 文件中添加值为true的属性CopyLocalLockFileAssemblies $ ,看看这是否会改变您的行为?

这是一个完整的 csproj 文件示例。

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
    <AWSProjectType>Lambda</AWSProjectType>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" />
    <PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="1.0.0" />
    <PackageReference Include="System.Data.SqlClient" Version="4.8.1" />
  </ItemGroup>
</Project>

@normj
我面临@ericmilaneze面临的同样问题。 添加提到的属性解决了这个问题。
谢谢!

有用!

谢谢,@normj!

@normj我们遇到了类似的问题并得到异常“System.IO.FileLoadException”,但堆栈跟踪略有不同。 我们尝试添加上面的属性,但没有解决问题。 当部署到 AWS 时,它工作正常。

我们正在使用 2.1 的最新测试工具,但是当我们使用为 .NET Standard 构建的 nuget 包时,我们会收到以下错误:

System.IO.FileLoadException:无法加载文件或程序集“Internal.Integration.Amy,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null”。 操作在当前状态下是不合法的。 (来自 HRESULT 的异常:0x80131509)
在 Internal.Inventory.Sync.Lambda.Function..ctor()
---------------- 内部 1 异常 ------------
System.InvalidOperationException:已解析程序集的简单名称应与请求的程序集相同。
在 System.Runtime.Loader.AssemblyLoadContext.ValidateAssemblyNameWithSimpleName(Assembly 程序集,字符串请求的SimpleName)
在 System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName 程序集名称)
在 System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext,AssemblyName assemblyName)

有任何想法吗?

 <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

添加这个对我有用。 我们可以暂时将其添加到 README 中吗?

    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

这是解决我问题的唯一方法

添加上述属性也为我解决了这个问题。

此页面是否有帮助?
0 / 5 - 0 等级