有没有办法捕获所有构建配置中的编译错误?
我对属性进行了简单的更改为自动属性,并破坏了构建,因为该属性在条件编译部分中被引用。我正在调试中构建,引用位于仅在发布配置中编译的代码部分。有没有办法捕获这些错误,而无需在 Visual Studio 中手动切换构建配置并在每种模式下构建?
我有一个 CI 服务器,所以错误立即被捕获,但我讨厌破坏构建。
I made a simple change of a property to an auto property and broke the build because the property was referenced in a conditional compilation section. I was building in debug and the reference was in a section of code that's only compiled in release configuration. Is there any way to catch these errors without manually switching the build configuration in Visual Studio and building in each mode?
I have a CI server so the error was caught right away but I hate breaking the build.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要构建每个配置以查看某些条件是否会破坏其中一个配置。不过,您可以使用构建菜单中的“批量构建”选项来避免手动步骤。
You need to build each configuration to see if something conditional breaks one of them. You can avoid the manual step using the 'batch build' option from the build menu though.
您必须在每个配置下构建。
请记住,如果您要同时使用所有条件编译部分,则很可能无法构建,即如果是调试则使用 a,如果不是则使用 b。
不过,您不需要手动执行此操作 - 也就是说,双倍编译时间是一件可怕的事情。
You have to build under each configuration.
Remember that if you were to use all the conditional compiled sections at the same time, its likely that it wouldn't build i.e. if is debug use a, if not use b.
You don't need to do it manually though - that said, double compilation time is an awful thing.