【问题标题】:Visual Studio Code 0.2.0 and opening .snl projectVisual Studio Code 0.2.0 和打开 .snl 项目
【发布时间】:2015-06-10 19:24:03
【问题描述】:

我在一些实验性 Unity3D 项目中使用了一些 Visual Studio Code。现在我收到了一封关于 0.2.0 更新的内部人员电子邮件,并决定试一试。更新后 VSCode 启动良好,但在尝试打开 .csproj 文件时遇到错误。

这是我的错误日志

[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Loading project from '/Users/username/Projects/NewSmallGame/NewSmallGame/Assembly-CSharp-vs.csproj'.
[WARNING:OmniSharp.MSBuild.MSBuildProjectSystem] Failed to process project file '/Users/username/Projects/NewSmallGame/NewSmallGame/Assembly-CSharp-vs.csproj'.
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.ThrowHelper.ThrowKeyNotFoundException () [0x00000] in <filename unknown>:0 
  at System.Collections.Generic.Dictionary`2[System.String,Microsoft.Build.BuildEngine.BuildProperty].get_Item (System.String key) [0x00000] in <filename unknown>:0 
  at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create (OmniSharp.Options.MSBuildOptions options, ILogger logger, System.String solutionDirectory, System.String projectFilePath, ICollection`1 diagnostics) [0x00000] in <filename unknown>:0 
  at OmniSharp.MSBuild.MSBuildProjectSystem.CreateProject (System.String projectFilePath) [0x00000] in <filename unknown>:0 
/Users/username/Projects/NewSmallGame/NewSmallGame/Assembly-CSharp-vs.csproj(0,0)
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.ThrowHelper.ThrowKeyNotFoundException () [0x00000] in <filename unknown>:0 
  at System.Collections.Generic.Dictionary`2[System.String,Microsoft.Build.BuildEngine.BuildProperty].get_Item (System.String key) [0x00000] in <filename unknown>:0 
  at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create (OmniSharp.Options.MSBuildOptions options, ILogger logger, System.String solutionDirectory, System.String projectFilePath, ICollection`1 diagnostics) [0x00000] in <filename unknown>:0 
  at OmniSharp.MSBuild.MSBuildProjectSystem.CreateProject (System.String projectFilePath) [0x00000] in <filename unknown>:0 

这绝不限于 Unity 项目,而是适用于所有项目。我尝试了一个用 MonoDevelop 生成的和一个用我下载的 Visual Studio 2010 生成的。

此错误的原因可能是什么?看来,VSCode 无法从文件中找到单个字符,因为它引用了

/Assembly-CSharp-vs.csproj(0,0)

【问题讨论】:

    标签: c# csproj visual-studio-code


    【解决方案1】:

    我不知道是什么导致了领导项目的错误,但它似乎已在新的 0.3.0 版本中得到修复。

    【讨论】:

      猜你喜欢
      • 2016-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多