引用混合模式程序集的 Azure 函数
Azure Function referencing mixed-mode assembly
TL;DR:是否可以在 Azure Functions 中使用混合模式程序集?
详细信息:我有一个内部混合模式程序集,我正尝试在 Azure 函数中使用它。当我尝试构建时,出现以下错误:
------ Build started: Project: AzureDemo, Configuration: Debug x64 ------
AzureDemo -> C:\src\local17\AzureDemo\bin\x64\Debug\net462\bin\AzureDemo.dll
C:\Users\hugh\.nuget\packages\microsoft.net.sdk.functions.0.2\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(31,5): error : Could not load file or assembly 'file:///C:\src\local17\AzureDemo\bin\x64\Debug\net462\bin\AzureDemo.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Done building project "AzureDemo.csproj" -- FAILED.
为清楚起见,内部库是 x64,我的演示项目也是 x64,所以这不是 x86/x64 问题。
此外,当我将代码从 Azure Function 项目中取出并将其放入一个普通的旧 .NET Core 2.0 项目中时,它构建得很好。 编辑:它 构建 很好,但它仍然没有 运行 (System.EntryPointNotFoundException: A library name must be specified in a DllImport attribute applied to non-IJW methods.
)。所以我的处境可能比我想象的要深。
我有点担心 Azure Functions 不能与混合模式程序集一起使用...但我还没有找到任何明确的声明。
我也有点担心它使用 netstandard1.0
的事实可能与它有关。
当 SDK 启动构建任务以生成构建 artifacts/function 元数据时,错误发生在构建时。
我已打开此问题并提供详细信息以跟踪错误:https://github.com/Azure/azure-functions-vs-build-sdk/issues/131
成功的本地测试还需要实际的 x64 CLI 版本,这在此处进行了跟踪:https://github.com/Azure/azure-functions-cli/issues/117
TL;DR:是否可以在 Azure Functions 中使用混合模式程序集?
详细信息:我有一个内部混合模式程序集,我正尝试在 Azure 函数中使用它。当我尝试构建时,出现以下错误:
------ Build started: Project: AzureDemo, Configuration: Debug x64 ------
AzureDemo -> C:\src\local17\AzureDemo\bin\x64\Debug\net462\bin\AzureDemo.dll
C:\Users\hugh\.nuget\packages\microsoft.net.sdk.functions.0.2\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(31,5): error : Could not load file or assembly 'file:///C:\src\local17\AzureDemo\bin\x64\Debug\net462\bin\AzureDemo.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Done building project "AzureDemo.csproj" -- FAILED.
为清楚起见,内部库是 x64,我的演示项目也是 x64,所以这不是 x86/x64 问题。
此外,当我将代码从 Azure Function 项目中取出并将其放入一个普通的旧 .NET Core 2.0 项目中时,它构建得很好。 编辑:它 构建 很好,但它仍然没有 运行 (System.EntryPointNotFoundException: A library name must be specified in a DllImport attribute applied to non-IJW methods.
)。所以我的处境可能比我想象的要深。
我有点担心 Azure Functions 不能与混合模式程序集一起使用...但我还没有找到任何明确的声明。
我也有点担心它使用 netstandard1.0
的事实可能与它有关。
当 SDK 启动构建任务以生成构建 artifacts/function 元数据时,错误发生在构建时。
我已打开此问题并提供详细信息以跟踪错误:https://github.com/Azure/azure-functions-vs-build-sdk/issues/131
成功的本地测试还需要实际的 x64 CLI 版本,这在此处进行了跟踪:https://github.com/Azure/azure-functions-cli/issues/117