Visual Studio 2022: just installed

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
emadsen
Posts: 440
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: Visual Studio 2022: just installed

Post by emadsen »

Chessnut1071 wrote: Thu Dec 09, 2021 5:25 am
CSO2034, BitOperations does not exist in the namespace System,Numerics
I'm just getting used to this new VS, using VS2022 N3t 7.3. I have a work around that's a 64-cycle loop which works but way too slow for what I need.
7.3 is the C# language version (and an old one at that). What version of the .NET runtime are you targeting? I’m guessing you’re targeting .NET Framework 4.7, not .NET Core (which was a separate runtime from the full framework in .NET Core 1, 2, and 3 but has since been unified in .NET 5+). Bitscan and popcount CPU intrinsics are not supported in .NET Framework, only in .NET Core 3, .NET 5, and .NET 6.

Do you really have requirements that permit using VS 2022 but do not permit targeting .NET 6? That seems odd to me.
Erik Madsen | My C# chess engine: https://www.madchess.net
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Visual Studio 2022: just installed

Post by dangi12012 »

emadsen wrote: Thu Dec 09, 2021 10:47 am
Chessnut1071 wrote: Thu Dec 09, 2021 5:25 am
CSO2034, BitOperations does not exist in the namespace System,Numerics
I'm just getting used to this new VS, using VS2022 N3t 7.3. I have a work around that's a 64-cycle loop which works but way too slow for what I need.
7.3 is the C# language version (and an old one at that). What version of the .NET runtime are you targeting? I’m guessing you’re targeting .NET Framework 4.7, not .NET Core (which was a separate runtime from the full framework in .NET Core 1, 2, and 3 but has since been unified in .NET 5+). Bitscan and popcount CPU intrinsics are not supported in .NET Framework, only in .NET Core 3, .NET 5, and .NET 6.

Do you really have requirements that permit using VS 2022 but do not permit targeting .NET 6? That seems odd to me.
I was using those instructions in VS 2015. They exist since a long time. He might just be trolling us at this point.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Chessnut1071
Posts: 313
Joined: Tue Aug 03, 2021 2:41 pm
Full name: Bill Beame

Re: Visual Studio 2022: just installed

Post by Chessnut1071 »

emadsen wrote: Thu Dec 09, 2021 10:47 am
Chessnut1071 wrote: Thu Dec 09, 2021 5:25 am
CSO2034, BitOperations does not exist in the namespace System,Numerics
I'm just getting used to this new VS, using VS2022 N3t 7.3. I have a work around that's a 64-cycle loop which works but way too slow for what I need.
7.3 is the C# language version (and an old one at that). What version of the .NET runtime are you targeting? I’m guessing you’re targeting .NET Framework 4.7, not .NET Core (which was a separate runtime from the full framework in .NET Core 1, 2, and 3 but has since been unified in .NET 5+). Bitscan and popcount CPU intrinsics are not supported in .NET Framework, only in .NET Core 3, .NET 5, and .NET 6.

Do you really have requirements that permit using VS 2022 but do not permit targeting .NET 6? That seems odd to me.
Below are my available targets:
Net Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.6, 4.71,4.72, 4.8, unity Net 3.5 full base Class Libraries
I'm using the free community version of VS 2022. Are you using the pro version?
R. Tomasi
Posts: 307
Joined: Wed Sep 01, 2021 4:08 pm
Location: Germany
Full name: Roland Tomasi

Re: Visual Studio 2022: just installed

Post by R. Tomasi »

Chessnut1071 wrote: Thu Dec 09, 2021 10:25 pm
emadsen wrote: Thu Dec 09, 2021 10:47 am
Chessnut1071 wrote: Thu Dec 09, 2021 5:25 am
CSO2034, BitOperations does not exist in the namespace System,Numerics
I'm just getting used to this new VS, using VS2022 N3t 7.3. I have a work around that's a 64-cycle loop which works but way too slow for what I need.
7.3 is the C# language version (and an old one at that). What version of the .NET runtime are you targeting? I’m guessing you’re targeting .NET Framework 4.7, not .NET Core (which was a separate runtime from the full framework in .NET Core 1, 2, and 3 but has since been unified in .NET 5+). Bitscan and popcount CPU intrinsics are not supported in .NET Framework, only in .NET Core 3, .NET 5, and .NET 6.

Do you really have requirements that permit using VS 2022 but do not permit targeting .NET 6? That seems odd to me.
Below are my available targets:
Net Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.6, 4.71,4.72, 4.8, unity Net 3.5 full base Class Libraries
I'm using the free community version of VS 2022. Are you using the pro version?
I'm using the free version of VS2022, too. Targets available to me are .Net Framwork from 2.0 up to 4.8, .Net Core from 1.0 up to 3.1, .Net Standard from 1.0 up to 2.1, .Net 5.0 and .Net 6.0. Maybe you need to check some option in VS Installation Manager to enable .Net 6.0.
Chessnut1071
Posts: 313
Joined: Tue Aug 03, 2021 2:41 pm
Full name: Bill Beame

Re: Visual Studio 2022: just installed

Post by Chessnut1071 »

R. Tomasi wrote: Thu Dec 09, 2021 11:05 pm
Chessnut1071 wrote: Thu Dec 09, 2021 10:25 pm
emadsen wrote: Thu Dec 09, 2021 10:47 am
Chessnut1071 wrote: Thu Dec 09, 2021 5:25 am
CSO2034, BitOperations does not exist in the namespace System,Numerics
I'm just getting used to this new VS, using VS2022 N3t 7.3. I have a work around that's a 64-cycle loop which works but way too slow for what I need.
7.3 is the C# language version (and an old one at that). What version of the .NET runtime are you targeting? I’m guessing you’re targeting .NET Framework 4.7, not .NET Core (which was a separate runtime from the full framework in .NET Core 1, 2, and 3 but has since been unified in .NET 5+). Bitscan and popcount CPU intrinsics are not supported in .NET Framework, only in .NET Core 3, .NET 5, and .NET 6.

Do you really have requirements that permit using VS 2022 but do not permit targeting .NET 6? That seems odd to me.
Below are my available targets:
Net Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.6, 4.71,4.72, 4.8, unity Net 3.5 full base Class Libraries
I'm using the free community version of VS 2022. Are you using the pro version?
I'm using the free version of VS2022, too. Targets available to me are .Net Framwork from 2.0 up to 4.8, .Net Core from 1.0 up to 3.1, .Net Standard from 1.0 up to 2.1, .Net 5.0 and .Net 6.0. Maybe you need to check some option in VS Installation Manager to enable .Net 6.0.
Thx. got it working in Net 5.0. You have to use static or the compiler goes bananas.

static ulong value = 64;
ulong result = System.Runtime.Intrinsics.X86.Bmi1.X64.TrailingZeroCount(value);