I have two predefined structs
Context // x86
Context64 // x64
I am trying to create an instance of one of these structs based on the process architecture. For example, if it was compiled as x86 it would create an instance of Context
and if it was compiled as x64 it would create instance of Context64
I am having trouble forming a statement that will swap between the two instances based on what the program was compiled as
So far I have tried the following
var compiledAsx64 = Environment.Is64BitProcess;
var context = compiledAsx64 ? new Context64() : new Context();
And
var compiledAsx64 = Environment.Is64BitProcess;
dynamic context = compiledAsx64 ? new Context64() : new Context();
However, both return errors stating that there is no implicit conversion between the two
I am trying to avoid making multiple variables. Is this possible and if so how could I accomplish it?