你好
我有一个.net core 2.1 Web应用程序。我向解决方案中添加了一个Azure Function应用。
我的函数应用程序引用了我的Web应用程序(因此我可以访问实体框架类)。
由于某种原因,我出现了堆栈溢出错误。
如果我不引用该Web应用程序,那么就没有问题。
如果我引用一个新的.netstandard 2类库,则没有问题。
我正在使用azure-functions-core-tools 2.4.419。
Warning 1
Severity Code Description Project File Line Suppression State
Warning MSB4011 "C:\Users\[myusername]\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.0.2\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.props" cannot be imported again. It was already imported at "C:\Code\Apps\Rubbish\WebAppWithFunctions\TestFunctionApp\obj\TestFunctionApp.csproj.nuget.g.props (17,5)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Code\Apps\Rubbish\WebAppWithFunctions\TestFunctionApp\TestFunctionApp.csproj] TestFunctionApp 38
Warning 2
Severity Code Description Project File Line Suppression State
Warning MSB4011 "C:\Users\[username]\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.0.2\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets" cannot be imported again. It was already imported at "C:\Code\Apps\Rubbish\WebAppWithFunctions\TestFunctionApp\obj\TestFunctionApp.csproj.nuget.g.targets (9,5)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Code\Apps\Rubbish\WebAppWithFunctions\TestFunctionApp\TestFunctionApp.csproj] TestFunctionApp 60
Warning 3:
Severity Code Description Project File Line Suppression State
Warning TestFunctionApp C:\Users\[username]\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.0.2\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets 20
Warning 4:
Severity Code Description Project File Line Suppression State
Warning Process is terminating due to StackOverflowException. TestFunctionApp C:\Users\[username]\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.0.2\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets 20
Error 1:
Severity Code Description Project File Line Suppression State
Error Metadata generation failed. TestFunctionApp C:\Users\[username]\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.0.2\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets 20
我的网络应用程序的CSProj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
</ItemGroup>
</Project>
网络应用上安装的Nuget软件包为:
Microsoft.AspNetCore.App 2.1.1
Microsoft.AspNetCore.Razor.Design 2.1.2
Microsoft.NETCore.App 2.1
预先感谢, 丹。