在 VS 2017 中保存用于测试的默认处理器架构 [英] Saving the default processor architecture for tests in VS 2017

查看:15
本文介绍了在 VS 2017 中保存用于测试的默认处理器架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Visual Studio Community 15.7.5,并且已将我的完整解决方案签入到 github.它包含 3 个项目,其中一个使用 google 测试框架.此外,我正在使用 Christian Soltenborn 的 VS 扩展Google 测试适配器".

I am using Visual Studio Community 15.7.5 and I have checked in my complete solution to github. It contains 3 projects, where one of them is using the google test framework. Additionally I am using the VS-extension "Google Test Adapter" from Christian Soltenborn.

现在我希望能够将我的解决方案从 github 克隆到任意位置在我的文件系统中,并立即准备好编译和运行包括谷歌测试在内的所有内容,而无需修改解决方案/项目设置中的某些内容.

Now I want to be able to clone my solution from github to an arbitrarily place in my filesystem and be instant ready to compile and running all stuff inclusive the google tests WITHOUT modifying something at the solution-/project-settings.

总而言之,现在一切正常,但对于每个克隆,我仍然必须手动将默认处理器架构设置为 x64.此设置未保存在解决方案/项目设置中.我认为这个特定设置保存在文件夹中的一些文件 .vs.但是这个文件夹是我的 .gitignore 文件的一部分,因为这个目录不应该被提交.

In the sum it works now all fine, but for each clone I still have to set the default processor architecture manually to x64. This setting is NOT saved in the solution-/project-settings. I think this specific setting is saved in some file(s) in the folder .vs. But this folder is part of my .gitignore-file, because this directory should not be committed.

我还尝试在解决方案中创建一些后缀为 .runsettings 的 XML 文件,然后我将其用作测试设置文件".这有效,但是这里保存的路径似乎是固定到解决方案实际目录的绝对路径.所以我需要为每个新克隆手动分配 .runsettings 文件,它有另一个目录位置.

I also tried to create some XML-file in the solution with the suffix .runsettings, which I used then as "test setting file". This works, but the path saved here seems to be an absolute path fixed to the actual directory of the solution. So I would need to assign manually the .runsettings-file for each new clone, which has another directory-location.

对于这个问题,我找不到任何真正的解决方案,其他人似乎也有类似的问题:
如何将 VS 测试处理器架构默认为 x64?

I could not find any real solution for this problem, and other people seems to have similar problems:
How can I default VS Test Processor Architecture to x64?

谁知道如何解决这个问题?也欢迎任何肮脏的黑客,最终完成工作.我无法想象,这问题(不是很奇怪)仍然存在,尽管微软很早就知道这个错误"!

Who has got any idea, how to solve this problem? Also any dirty hacks are welcome, which do finally the job. I cannot imagine, that this problem (not really very exotic) is still present, although microsoft knows this "bug" for a long time!

推荐答案

这似乎是一个功能/错误.要在 x64 中永久测试,您需要创建一个 XXX.runsettings 作为解决方案项,设置 x64 架构,如 此处:

This appears to be a feature/bug. To permanently test in x64 you need to create a XXX.runsettings as a solution item, that sets x64 architecture, as described here:

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <RunConfiguration>
    <TargetPlatform>x64</TargetPlatform>
  </RunConfiguration>
</RunSettings>

这篇关于在 VS 2017 中保存用于测试的默认处理器架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆