【问题标题】:dotnet build produces NullReferenceExceptiondotnet build 产生 NullReferenceException
【发布时间】:2016-07-05 17:24:20
【问题描述】:

我对一个已知的工作项目进行了更改,现在我在使用dotnet build 构建时得到以下信息:

λ dotnet build
Object reference not set to an instance of an object.

更改是在 frameworks 部分添加了一个新框架,该框架在过去一直有效。我不确定它为什么突然停止工作。

【问题讨论】:

    标签: .net .net-core dotnet-cli


    【解决方案1】:

    这是 dotnet CLI 中已知的 bug。如果您向project.json 添加新框架但不运行dotnet restore,则会发生这种情况。

    先恢复解决问题:

    λ dotnet restore
    
    log  : Restore completed in 2138ms.
    
    λ dotnet build
    
    Compilation succeeded.
        0 Warning(s)
        0 Error(s)
    

    【讨论】:

      猜你喜欢
      • 2020-01-16
      • 1970-01-01
      • 1970-01-01
      • 2017-07-14
      • 2018-02-27
      • 1970-01-01
      • 2019-02-08
      • 1970-01-01
      • 2021-03-05
      相关资源
      最近更新 更多