"OpenStudio does not work correctly on 'AnyCPU' platform. You need to specify platform (x86 or x64)" #5104
Labels
Triage
Issue needs to be assessed and labeled, further information on reported might be needed
Issue overview
OpenStudio 3.7 prohibits building a C# project which is set to 'AnyCPU' as its target (which is the default). But this was not the case previously (at least not in version 3.2.1).
I haven't come across any other Nuget packages (including some with platform dependencies) that prevent building as AnyCPU. Even when they have platform dependencies; for example, https://github.com/mathnet/mathnet-numerics.
Previously our builds were all set to AnyCPU, the .NET / C# default. Using that setting most Visual Studio / MSBUILD settings and configuration could just be left in their simplest, default state. Because of this restriction against AnyCPU we've had to modify this which makes our builds more complex to maintain.
Current Behavior / Reproduction
To reproduce this, create a new .NET 8 project in Visual Studio 2022 using the "class library" project template. Then go to Nuget in VS and add OpenStudio 3.7. Compile. No code changes needed. The entire project file is listed below:
This results in the following compilation error:
Following the path in the error you can see where this originates, in the
OpenStudio.targets
file:I attached this example: os37test.zip
This is not dependent on the .NET version, for instance it does it in .NET Framework 4.8 also.
Thanks!
Details
Environment
The text was updated successfully, but these errors were encountered: