Reputation: 1
some time ago I worte a Text to Speech and Speech to Text bot with Visual Studio. It works fine on my Windows PC. I decided to bring this software to a Raspberry Pi 4 with Raspbian, but when I tried loading my Application this Error Popped Up:
Unhandled Exception: System.TypeLoadException: Could not load type of field 'MyAppName.Form1:speechRecognizer' (2) due to: Could not load file or assembly 'Microsoft.CognitiveServices.Speech.csharp, Version=1.6.0.28, Culture=neutral, PublicKeyToken=d2e6dcccb609e663' or one of its dependencies. [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type of field 'MyAppName.Form1:speechRecognizer' (2) due to: Could not load file or assembly 'Microsoft.CognitiveServices.Speech.csharp, Version=1.6.0.28, Culture=neutral, PublicKeyToken=d2e6dcccb609e663' or one of its dependencies.
I'm new to Linux and don't know how to fix this!
Upvotes: 0
Views: 328
Reputation: 175
If you want to run windows application on raspberry pi I think you should use Windows IoT core OS in Raspberry Pi 4.
Upvotes: 0
Reputation: 24138
It sounds like you want to create a GUI app using Microsoft.CognitiveServices.Speech
in C# and make it running on Raspberry Pi 4 with Raspbian OS.
Of couse, as @Rabban said in comments, WinForms
is only supported for Windows, even for .NET Core (a cross-platform version of .NET), you can refer to the content of README.md
of GitHub repo dotnet/winforms
to know it.
So for realizing your needs, the necessary requirement is all frameworks, libraries, and runtime you want to used which must be supported for Linux on ARM CPU. Then, I researched for it, as below.
For Microsoft.CognitiveServices.Speech
, I downloaded its nuget package from https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech and use 7zip
to see its runtimes
as the figure below, then I was sure it's supported for Linux on ARM64 CPU. Yes, the latest Raspbian version Buster
supports ARM64 for Respberry Pi 4.
For GUI and .NET runtime, .NET Core is the only choice for Linux on Boardcom ARM CPU for Raspberry Pi. Then, I know Avalonia
is a cross platform XAML in C# for .NET Core, and according to the description of its GitHub repo, as the figure, I think it may support Raspbian and ARM CPU because of the experimental support for Android and iOS.
Meanwhile, there is an open issue Avalonia on Raspbian #1072 to discuss for it. And for compatibility, please use .NET Core 2.1 and download it from https://dotnet.microsoft.com/download/dotnet-core/2.1, as the figure below.
Finally, the last suggestion for developing I think is to develop your app using .NET Core and Avalonia in Visual Studio and make it run on PC, and then copy the source code of the project on PC to your Respbian of Respberry Pi 4 to make it as a .NET Core project to try to re-build it to run.
Upvotes: 1