【发布时间】: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