带有 .net core 2 class 库的 Azure 函数
Azure function with .net core 2 class library
由于 ASP.Net Core 中仍然不支持 Webjobs,我将改用 Azure 函数。
我有 2 个 class 库是在 .net core 2 上构建的。我可以毫无问题地将它们引用到我的 Azure 函数项目,但是当我尝试发布时出现此错误。
这是 Azure 函数对我的库的引用
关于如何使这项工作有任何想法吗?不改变我的 class lib?
Azure Functions 当前不支持 .Net Core 2(更具体地说,.Net Standard 2),但是,似乎该团队正在积极努力获得这种支持...请参见此处:Port runtime to .NET Core
Runtime will be ported to target Netstandard 2.0.
根据您的库的功能,您可能会看到是否可以改用他们目前支持的 Netstandard 1.3
This issue will track the .NET Core port activities for porting the runtime to .NET core. Note that netstandard 1.3 assemblies can be used on Azure Functions and this is fully supported.
更新:根据@derape 评论增加了清晰度
Since there is still no support for Webjobs in ASP.Net Core
我的理解是 VS 工具还没有准备好,所以你不能有针对它的项目模板,或者一些简单的 发布为 webjobs 菜单项。
但据我阅读博文,您可以创建一个 .NET Core 控制台应用程序,将一些 .cmd
文件添加到项目根目录,内容如下:
REM run.cms - Webjob entry point
@echo off
dotnet MyNetCoreConsoleApplication.dll
将其包含在已发布的文件集中(使用 project.json "publishOptions": { "include": [...] }
,最后使 webjob 指向该 cmd 脚本。参见示例 here,或搜索 azure webjobs dotnet core.
.NET Core 2.0 现在受 Azure Functions 支持。
https://blogs.msdn.microsoft.com/appserviceteam/2017/09/25/develop-azure-functions-on-any-platform/
由于 ASP.Net Core 中仍然不支持 Webjobs,我将改用 Azure 函数。
我有 2 个 class 库是在 .net core 2 上构建的。我可以毫无问题地将它们引用到我的 Azure 函数项目,但是当我尝试发布时出现此错误。
这是 Azure 函数对我的库的引用
关于如何使这项工作有任何想法吗?不改变我的 class lib?
Azure Functions 当前不支持 .Net Core 2(更具体地说,.Net Standard 2),但是,似乎该团队正在积极努力获得这种支持...请参见此处:Port runtime to .NET Core
Runtime will be ported to target Netstandard 2.0.
根据您的库的功能,您可能会看到是否可以改用他们目前支持的 Netstandard 1.3
This issue will track the .NET Core port activities for porting the runtime to .NET core. Note that netstandard 1.3 assemblies can be used on Azure Functions and this is fully supported.
更新:根据@derape 评论增加了清晰度
Since there is still no support for Webjobs in ASP.Net Core
我的理解是 VS 工具还没有准备好,所以你不能有针对它的项目模板,或者一些简单的 发布为 webjobs 菜单项。
但据我阅读博文,您可以创建一个 .NET Core 控制台应用程序,将一些 .cmd
文件添加到项目根目录,内容如下:
REM run.cms - Webjob entry point
@echo off
dotnet MyNetCoreConsoleApplication.dll
将其包含在已发布的文件集中(使用 project.json "publishOptions": { "include": [...] }
,最后使 webjob 指向该 cmd 脚本。参见示例 here,或搜索 azure webjobs dotnet core.
.NET Core 2.0 现在受 Azure Functions 支持。
https://blogs.msdn.microsoft.com/appserviceteam/2017/09/25/develop-azure-functions-on-any-platform/