Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Problem running tests in x64
Magbr
#1 Posted : Friday, November 13, 2020 5:47:19 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/25/2016(UTC)
Posts: 29

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
I need to run some tests in x64.

Having this issue: https://github.com/dotne...#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
#2 Posted : Friday, November 13, 2020 8:28:26 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
1 user thanked Remco for this useful post.
Magbr on 11/16/2020(UTC)
Magbr
#3 Posted : Monday, November 16, 2020 11:49:51 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/25/2016(UTC)
Posts: 29

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Remco;15060 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
#4 Posted : Monday, November 16, 2020 1:14:59 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/25/2016(UTC)
Posts: 29

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Magbr;15073 wrote:
Remco;15060 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..
1 user thanked Magbr for this useful post.
Remco on 11/16/2020(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.040 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download