【问题标题】:VS2015 builds invalid .NET Core codeVS2015 构建无效的 .NET Core 代码
【发布时间】:2016-12-29 13:27:07
【问题描述】:

我的环境:

  • VS 2015,全新安装更新 3 (14.0.25431.01)
  • Windows 10,最新更新
  • 已安装 .NET Core 1.0.3 SDK (LTS)、.NET Core 1.1 SDK(当前)及其运行时
  • VS 2015 工具预览 2 (.NET Core)
  • 没有 ReSharper

我的 dotnet 信息

C:\Users\Ben>dotnet --info
.NET Command Line Tools (1.0.0-preview2-1-003177)

Product Information:
 Version:            1.0.0-preview2-1-003177
 Commit SHA-1 hash:  a2df9c2576

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64

为什么 VS 2015 认为,这里的构建很好?它无法编译。 CLI 工作正常:

PM> dotnet build **/project.json
Project VS2015NetCore (.NETCoreApp,Version=v1.1) will be compiled because expected outputs are missing
Compiling VS2015NetCore for .NETCoreApp,Version=v1.1
dotnet : C:\Program Files\dotnet\dotnet.exe compile-csc @C:\Users\Ben\documents\visual studio 
2015\Projects\VS2015NetCore\src\VS2015NetCore\obj\Debug\netcoreapp1.1\dotnet-compile.rsp returned Exit Code 1
At line:1 char:1
+ dotnet build **/project.json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (C:\Program File...ned Exit Code 1:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

C:\Users\Ben\documents\visual studio 2015\Projects\VS2015NetCore\src\VS2015NetCore\Program.cs(7,28): error CS0246: The type or namespace name 'ThisClassDoesNotExist' could not 
be found (are you missing a using directive or an assembly reference?)

【问题讨论】:

  • 它给你一个非0的退出代码,并且在底部有一个错误。
  • @Carcigenicate 所以你确认这是一种常见的行为?我不这么认为。
  • 我不是说这是通常的行为,我是说我认为它实际上并没有编译。它似乎抛出了一个错误。

标签: visual-studio-2015 .net-core


【解决方案1】:

我认为这是一个普遍问题。但为什么?还有什么?

如果我修复了错误,我会从 CLI 收到一般非 0 错误:

关于dotnet cli repo,错误0x80008081是由by an invalid argument引起的。

【讨论】:

    【解决方案2】:

    重新安装了我的机器。现在它起作用了。 常见的windows问题解决方法...

    【讨论】:

      猜你喜欢
      • 2017-07-12
      • 2018-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-14
      • 1970-01-01
      相关资源
      最近更新 更多