No job functions found in Azure Functions project (.NET standard 2.0) local

瘦欲@ 提交于 2019-12-06 10:17:09

问题


I'm trying to create a Azure Functions project in .NET standard 2.0 because I need to use a .NET standard 2.0 class library in this project.

However when I try to create a simple Azure Functions project and run it locally, I get the following error:

https://imgur.com/iDUrgYB.jpg

As I said before my code is very basic but I'll share it anyway.

My .csproj file:

https://i.imgur.com/z5JiLn4.png

My Queue Trigger:

https://i.imgur.com/HPzU4P4.png

My Program.cs:

https://i.imgur.com/9hMujDV.png

(I'm sorry for the links, I can't post images yet)


回答1:


  1. You don't have to target Function App project to .NET Standard in order to use .NET Standard libraries. You can do that from a project targeting Full Framework (net461).

  2. If you want to target .NET Standard, you need 2.0/Core version (still in preview) of Azure Functions tools to be able to run them. You can install these by running npm install -g azure-functions-core-tools@core and then running func start from your publish folder. Note that this func will be in %APPDATA%\Roaming\npm, not %APPDATA%\Local\Azure.Functions.Cli\1.0.7 as in your example.

  3. If you want to run .NET Standard project from Visual Studio, you need 15.5 version preview, see Improvements to Azure Functions in Visual Studio.

  4. Please remove Program.cs: it's not needed for Functions project.



来源:https://stackoverflow.com/questions/47534482/no-job-functions-found-in-azure-functions-project-net-standard-2-0-local

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!