【问题标题】:A project with an Output Type of Class Library cannot be started directly , Azure Function in VS 2022输出类型为类库的项目无法直接启动,VS 2022中的Azure Function
【发布时间】:2022-01-27 11:12:22
【问题描述】:

我最近将我的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.

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

可能是什么问题?

【问题讨论】:

    标签: azure visual-studio azure-functions


    【解决方案1】:

    尝试清理并重建您的项目。此外,如果您有多个项目,请尝试设置一个启动项目,然后编译相同的项目。

    您可以尝试以下几种解决方法

    1. 尝试清理并重建您的解决方案。

    2. 如果您有多个项目,请尝试设置一个启动项目,然后编译相同的项目。

    3. 如果上述方法不起作用,请尝试将新项目添加到您的解决方案并设置控制台应用程序或 Windows 应用程序的输出类型。 为此,您可以通过右键单击您的项目导航到您的属性

    参考: A project with an Output type of Class Library cannot be started directly

    【讨论】:

      【解决方案2】:

      我让它工作了。好像安装过程中没有选择Azure Development。

      【讨论】:

        【解决方案3】:

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

        【讨论】:

        • 我已经尝试过第 3 点,但没有奏效。新项目在控制台上启动,但不是我的项目。
        • 我使用的是 Net core 3.1
        猜你喜欢
        • 2011-03-22
        • 1970-01-01
        • 2010-10-19
        • 2016-07-03
        • 2012-06-24
        • 1970-01-01
        • 2012-08-31
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多