在Visual Studio 2017中具有Azure功能的目标.NET Core 2.0 [英] Target .NET Core 2.0 with Azure Functions in Visual Studio 2017

查看:93
本文介绍了在Visual Studio 2017中具有Azure功能的目标.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功能

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

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

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

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