输出类型为类库的项目无法直接启动,VS 2022 中的 Azure Function

use*_*863 5 azure visual-studio azure-functions

我最近将 VS 更新到了 2022。我的项目是 Azure Function App。

但是当我单击调试项目时,出现以下错误。

A project with an Output Type of Class Library cannot be started directly 
        
In order to debug this project, add an executable project to this solution which 
references the library project. Set the executable project as the startup project.
Run Code Online (Sandbox Code Playgroud)

通常,我的功能应用程序运行时会出现提示屏幕。

可能是什么问题?

use*_*863 9

我成功了。似乎在安装过程中没有选择Azure Development。

  • 对,就是那样。安装“Azure WebJobs Tools”后它对我有用。 (2认同)

小智 0

奇怪,因为 azure 函数在 VS2022 中工作对我来说没有任何问题,你的函数中使用了哪个版本的目标框架?