简体   繁体   English

VS2015 解决方案构建给出编译错误

[英]VS2015 solution build giving compile error

I've been battling with a bizarre compilation error that I've been getting when running VS2015.我一直在与运行 VS2015 时遇到的一个奇怪的编译错误作斗争。 The error is that when I compile (rebuild) a solution (it's a large solution, with 96 projects), I get a compilation error.错误在于,当我编译(重建)一个解决方案(它是一个大型解决方案,有 96 个项目)时,出现编译错误。 The error is:错误是:

70>------ Rebuild All started: Project: MyBase, Configuration: Debug Any CPU ------ 70>I:\\WS\\Main\\Common\\MyBase\\MyBase\\BaseApplication.cs(1,7,1,10): error CS0246: The type or namespace name 'MyProject' could not be found (are you missing a using directive or an assembly reference?) 70>------ 重建全部开始:项目:MyBase,配置:调试任何 CPU ------ 70>I:\\WS\\Main\\Common\\MyBase\\MyBase\\BaseApplication.cs(1,7, 1,10):错误 CS0246:找不到类型或命名空间名称“MyProject”(您是否缺少 using 指令或程序集引用?)

So, the first thing that I did was try to compile MyBase , and it compiles fine.所以,我做的第一件事就是尝试编译MyBase ,它编译得很好。 I then individually compiled (rebuild) various groups of projects, until it finally errored when trying to compile the first project that used MyBase, giving a slightly different error:然后我单独编译(重建)了不同的项目组,直到在尝试编译第一个使用 MyBase 的项目时最终出错,给出了一个稍微不同的错误:

44>------ Rebuild All started: Project: MyBase, Configuration: Debug Any CPU ------ 44>------ 重建全部开始:项目:MyBase,配置:调试任何CPU------

43>CSC : error CS0006: Metadata file 'I:\\WS\\Main\\Common\\MyBase\\MyBase\\bin\\Debug\\MyBase.dll' could not be found 43>CSC:错误 CS0006:找不到元数据文件“I:\\WS\\Main\\Common\\MyBase\\MyBase\\bin\\Debug\\MyBase.dll”

The next thing that I tried was an MSBuild on the command line of the entire solution - which worked.我尝试的下一件事是在整个解决方案的命令行上使用 MSBuild - 它起作用了。

Finally, returning to VS2015, i tried doing a rebuild, and then a build, and the solution didn't error.最后回到VS2015,尝试了rebuild,然后build,解决方法没有报错。

Looking at the numbers in the build, it looks to me like it is executing some of the build steps out of synch (44 before 43).查看构建中的数字,在我看来,它正在执行一些不同步的构建步骤(44 比 43)。 Is this possible?这可能吗? Is there some kind of asynchronous build that has crept into VS and started causing this behaviour.是否有某种异步构建已经进入 VS 并开始导致这种行为。 I've double and triple checked the dependencies, and they seem fine to me.我已经对依赖项进行了两次和三次检查,它们对我来说似乎很好。

Visual Studio 2015 supports parallel compiles. Visual Studio 2015 支持并行编译。 If some of your projects depend on each other you have to set up project dependencies.如果您的某些项目相互依赖,则必须设置项目依赖项。 You can do this with the project dependencies menu point in the project menu.您可以使用项目菜单中的项目依赖项菜单点执行此操作。 See MSDN for details.有关详细信息,请参阅MSDN

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM