构建时不支持给定路径的格式 "obj\Debug\C:\..."

The given path's format is not supported "obj\Debug\C:\..." on build

我正在尝试构建一个不是我创建的项目。 VS 给我错误:

Could not write lines to file "obj\Debug\C:\...". The given path's format is not supported.

我已将完整路径替换为“...”。注意路径被"C:..."

打断

任何人都知道 VS 使用什么来形成这条路径以及我可以在哪里更改它?它尝试写入的文件类型是 .csprojccrefgen.rsp.

这不是有效路径,: 不能作为文件夹名称出现。检查设置为输出目录的内容:

To change the build output directory:

  1. On the menu bar, choose Project, Appname Properties.

  2. Choose the Build tab.

  3. Choose the Browse button next to the Output path box and specify a new build output directory.

https://msdn.microsoft.com/en-us/library/ms165410.aspx

原来是因为 VS 的 Code Contracts for .NET 插件安装无效。我必须从这里安装最新版本,这解决了问题:

https://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970