Saving the default processor architecture for tests in VS 2017

不问归期 提交于 2019-12-24 01:12:58

问题


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.

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.

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.

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.

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!


回答1:


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>


来源:https://stackoverflow.com/questions/51524801/saving-the-default-processor-architecture-for-tests-in-vs-2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!