I need to run some tests in x64.
Having this issue: https://github.com/dotnet/machinelearning-samples/issues/733#issuecomment-548627434
Not able to change to .net core 3.1 because of other dependents with .net framework.
I found three different configuration options to change build platform. I've tried countless combinations of these for test project, project under test and entire solution. It either doesn't work or it breaks more or less everything..
What's the correct approach/config to get this running in x64 mode?
Options tried:
Use build platform
Build process cpu architecture
Use cpu architecture
Also tried manually specifying x64 platform in both projects without any luck.
Cheers!
Best Magnus
Remco NCrunch Developer
#15060
13 Nov 2020 20:28 UTC
Be sure to check the documentation for each of these options to have an understanding of what they do.
In this situation, the best way to fix the problem isn't actually with NCrunch configuration. If one of your projects can only run within an x64 environment, it is then structurally important that any project depending on this project is also set to target x64. In this way, there is no way your code can be run outside of the x64 environment.
The best option is to go into the VS build settings of each of your projects that rely on this project (including your test projects), and set this to target the x64 platform. NCrunch will detect this and adapt accordingly.
If you're looking to just force NCrunch to use x64 for your test project, set the 'Use CPU Architecture' setting on the test project to x64.
In this situation, the best way to fix the problem isn't actually with NCrunch configuration. If one of your projects can only run within an x64 environment, it is then structurally important that any project depending on this project is also set to target x64. In this way, there is no way your code can be run outside of the x64 environment.
The best option is to go into the VS build settings of each of your projects that rely on this project (including your test projects), and set this to target the x64 platform. NCrunch will detect this and adapt accordingly.
If you're looking to just force NCrunch to use x64 for your test project, set the 'Use CPU Architecture' setting on the test project to x64.
Remco wrote:Be sure to check the documentation for each of these options to have an understanding of what they do.
In this situation, the best way to fix the problem isn't actually with NCrunch configuration. If one of your projects can only run within an x64 environment, it is then structurally important that any project depending on this project is also set to target x64. In this way, there is no way your code can be run outside of the x64 environment.
The best option is to go into the VS build settings of each of your projects that rely on this project (including your test projects), and set this to target the x64 platform. NCrunch will detect this and adapt accordingly.
If you're looking to just force NCrunch to use x64 for your test project, set the 'Use CPU Architecture' setting on the test project to x64.
Thanks Remco!
So forcing it to x64 with 'Use CPU Architecture' for the entire solution should be equivalent as changing the 60 project's targets? You see it takes a while to do this so it would be nice to know that it will work.
So far, this doesn't work. I get the same exception as before. Is there a way to see/check that it was run in x64?
Magbr wrote:Remco wrote:Be sure to check the documentation for each of these options to have an understanding of what they do.
In this situation, the best way to fix the problem isn't actually with NCrunch configuration. If one of your projects can only run within an x64 environment, it is then structurally important that any project depending on this project is also set to target x64. In this way, there is no way your code can be run outside of the x64 environment.
The best option is to go into the VS build settings of each of your projects that rely on this project (including your test projects), and set this to target the x64 platform. NCrunch will detect this and adapt accordingly.
If you're looking to just force NCrunch to use x64 for your test project, set the 'Use CPU Architecture' setting on the test project to x64.
Thanks Remco!
So forcing it to x64 with 'Use CPU Architecture' for the entire solution should be equivalent as changing the 60 project's targets? You see it takes a while to do this so it would be nice to know that it will work.
So far, this doesn't work. I get the same exception as before. Is there a way to see/check that it was run in x64?
Looks like this doesn't have anything to do with NCrunch(afaik), adding a direct reference to Microsoft.ML from the test project. Along with the targeting x64 did the trick.
Sorry for taking your time..
Post a reply
Log in to reply.