0

We have a large WinForms application that we will not be re-writing (in WPF for example) any time soon. Microsoft continues to actively support Winforms.

We generally have our Winforms build configuration set to AnyCPU for development, and the MSBuild process that deploys it builds it as 64 bit. The development configuration is set to AnyCPU because of the well-known problem that the Visual Designer of Winforms fails to work if the app is built as 64 bit. Switching back and forth to do UX design is not too painful. However, we have now hit an issue where we want to include a NuGet package for Microsoft.CognitiveServices.Speech in our WinForms app. This assemblies requires 64 bit, and you will get a compiler error if the app is set to AnyCPU. This removes our ability to switch over to AnyCPU for UX design.

One work-around we could do is that we have an older version of Microsoft.CogitiveServices.Speech that does allow AnyCPU, but that version is no longer available via NuGet, so we would have to check the package into source control (yuck).

Is there anything I can do to allow a WinForms app to remain set to AnyCPU, but reference an assembly that apparently demands 64 bit only?

Kevin MacDonald
  • 650
  • 8
  • 21
  • 1
    Compiler error??? Surely you know you should mention a diagnostic you see? The link *warning* is not an error. – Hans Passant May 19 '20 at 19:47
  • I am a bit flummoxed. The error is intermittent. When it happens, it is an error (with red X in VS) and the compile has definitely failed. But the Error Code is absent! I see errors like that from time to time where VS gives no information about what the problem is. – Kevin MacDonald May 20 '20 at 17:54
  • @HansPassant Hans just wanted you to see what I sometimes see in VS. See snapshot below. – Kevin MacDonald May 21 '20 at 17:16

2 Answers2

0

As I commented, the compiler error that shows up in VS2017 is intermittent and when it appears the Error Code is absent from the Errors list. The error says "Microsoft.CogitiveServices.Speech does not support AnyCPU", or close to that. Since I cannot reliably reproduce it I'll not trouble anyone for answers until I can.

Kevin MacDonald
  • 650
  • 8
  • 21
0

The snapshot shows what I see in VS 2017. Mystery error which makes the compile fail, sometimes!! The snapshot shows what I see in VS 2017. Mystery error which makes the compile fail, sometimes!!

Kevin MacDonald
  • 650
  • 8
  • 21