This issue describes the status of support for AnyCPU in SQLitePCLRaw 3.x.
Note that this issue is applicable only for .NET Framework, not for modern .NET, aka the descendants of .NET Core, aka .NET 8.0, 9.0, 10.0, etc.
As a bit of background, I define "proper" support for AnyCPU to mean:
(1) Placing an unmanaged/native DLL for each CPU architecture into the build output.
(2) At runtime, checking the architecture of the current process and dynamically loading the proper DLL.
Before the 3.0 release, AnyCPU didn't work properly. The build would succeed, but attempts to run the resulting build on multiple CPU architectures would usually fail at runtime. Most people didn't notice, because most people don't actually need AnyCPU. They build that way because it was the default, but in practice, they only run on x64.
But for the sake of correctness, in the 3.0 release, I changed the runtime error to a build-time error. This ensures that people who really need AnyCPU will actually be informed as early as possible that it's not going to work.
But the main result of this change is that lots of people think I removed AnyCPU support.
We are currently working to implement proper support for AnyCPU. Follow this issue to see progress on that.
In the meantime, if you are trying to build with AnyCPU but you don't really need it, you currently have two options for avoiding the build-time error message:
(a) Don't use AnyCPU. Change your build configuration to x64.
(b) Stay with AnyCPU and add a RuntimeIdentifier property to your project.
This issue describes the status of support for AnyCPU in SQLitePCLRaw 3.x.
Note that this issue is applicable only for .NET Framework, not for modern .NET, aka the descendants of .NET Core, aka .NET 8.0, 9.0, 10.0, etc.
As a bit of background, I define "proper" support for AnyCPU to mean:
(1) Placing an unmanaged/native DLL for each CPU architecture into the build output.
(2) At runtime, checking the architecture of the current process and dynamically loading the proper DLL.
Before the 3.0 release, AnyCPU didn't work properly. The build would succeed, but attempts to run the resulting build on multiple CPU architectures would usually fail at runtime. Most people didn't notice, because most people don't actually need AnyCPU. They build that way because it was the default, but in practice, they only run on x64.
But for the sake of correctness, in the 3.0 release, I changed the runtime error to a build-time error. This ensures that people who really need AnyCPU will actually be informed as early as possible that it's not going to work.
But the main result of this change is that lots of people think I removed AnyCPU support.
We are currently working to implement proper support for AnyCPU. Follow this issue to see progress on that.
In the meantime, if you are trying to build with AnyCPU but you don't really need it, you currently have two options for avoiding the build-time error message:
(a) Don't use AnyCPU. Change your build configuration to x64.
(b) Stay with AnyCPU and add a
RuntimeIdentifierproperty to your project.