- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 .net 6.0 开发了 Azure Function v4。它只包含http触发的函数。
本地一切正常,但将其部署到 Azure 后,我通过调用任何端点只能获得 500 状态代码,并且它总是在 Microsoft.Azure.WebJobs.Script.Workers 抛出
:未找到任何初始化的语言 worker InvalidOperationException
。 Rpc.RpcFunctionInitationDispatcherLoadBalancer.GetLanguageWorkerChannel
更新添加更多信息
项目文件:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.20.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.6.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.0.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.3.0" OutputItemType="Analyzer" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
本地.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"StorageConnectionString": "UseDevelopmentStorage",
"APPINSIGHTS_INSTRUMENTATIONKEY": "MyInstrumentationKey"
},
"Host": {
"LocalHttpPort": 7071,
"CORS": "*"
}
}
最佳答案
解决此问题的解决方法之一:
这是配置:
部署后,函数URL运行成功:
<小时/>
WEBSITE_NODE_DEFAULT_VERSION
的设置已添加到您的 .Net Function App 配置设置中。
如果您的函数不是使用 node.js 创建的,并且您没有在代码中显式使用此应用程序设置,那么您可以从函数应用程序中删除此属性。这在MSFT Q&A中有说明。 .
注意:5. 尝试在 Azure 门户中重新创建函数应用程序(.Net 6 - Windows 操作系统 - 西欧位置),并从 Visual Studio 部署 HTTP 触发器函数。或者6. 尝试删除 WEBSITE_NODE_DEFAULT_VERSION
设置 > 保存 > 在 azure 门户中重新启动应用并运行该函数。7. 确保函数应用 local.settings.json
文件中的此设置为 "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated
"。8、该错误可能是由于Functions Worker版本与SDK版本不匹配导致。如果有任何可用更新,请通过 NuGet Packet Manager 进行更新:
此外,此错误存在于以前版本的 dotnetisolated 5 和 Azure Functions 版本 V3 中。
引用文献:
关于c# - 运行 dotnet 隔离的 AzureFunction 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70762049/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!