在 Visual Studio 2017 中使用 Azure Functions 定位 .NET Core 2.0 [英] Target .NET Core 2.0 with Azure Functions in Visual Studio 2017

查看:16
本文介绍了在 Visual Studio 2017 中使用 Azure Functions 定位 .NET Core 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于微软几天前发布了用于 Azure Functions 的 .NET Core 2.0,我试图了解如何在 VS2017 中针对 .NET Core 创建一个新的 Functions 项目.

Since Microsoft has released .NET Core 2.0 for Azure Functions a few days ago, I'm trying to understand how to create a new Functions project in VS2017 targeting .NET Core.

我尝试了很多配置,但最终还是使用 .NET 4.7.

I've tried many configurations and still ended up with .NET 4.7.

是否有人设法创建了针对 .NET Core 的新函数?

Did anyone manage to create a new Function targeting .NET Core?

谢谢.

推荐答案

目前,这是一个手动过程.您需要创建 .NET Standard 2.0 库,手动添加 function.json 并使用核心工具运行它.

For now, it's a manual process. You need to create .NET Standard 2.0 library, add function.json manually and run it with core tools.

Microsoft.NET.Sdk.Functions 包还不支持 .NET Standard 2.0 类库.这是将项目标识为 Visual Studio 的 Functions 项目并在构建期间从属性生成 function.json 的包.

the package Microsoft.NET.Sdk.Functions does not yet support .NET Standard 2.0 class libraries. This is the package that identifies a project as Functions project to Visual Studio and generates function.json from attributes during build.

您仍然可以创作面向 .NET Standard 2.0 的 C# 类库,但您必须使用手动创作的 function.json.C# 类库的模板在 Core Tools 中尚不可用,但您可以从 GitHub 获取示例.

You can still author C# class libraries that target .NET Standard 2.0, but you must use a manually-authored function.json. The templates for C# class libraries aren’t yet available in the Core Tools, but you can get a sample from GitHub.

来自 开发任何平台上的 Azure Functions

更新:1.0.5 版本的 SDK 现在应该支持它,正如 Fabio 所说.

Update: 1.0.5 version of SDK should now support it, as mentioned by Fabio.

这篇关于在 Visual Studio 2017 中使用 Azure Functions 定位 .NET Core 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆