1

I have developed, in Visual Studio 2015, a C# Console Application which uses the Discord.Net API. It works great running on my PC, which has Windows 10, however I am looking to run the program 24/7 on a Raspberry Pi.

The device I have is a Raspberry Pi 3 Model B+. It currently runs on the Raspberry Pi 3 B+ Technical Preview Build 17661 offered by Microsoft. I added all the files from my project's \bin\Debug directory to my Pi's SD Card. I open the Windows Device Portal, and enter the command prompt to run the .exe file from its path. However, doing so returns this error log:

Unhandled Exception: System.TypeLoadException: Could not load type 'System.Runtime.Serialization.SerializationBinder' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
   at Newtonsoft.Json.JsonSerializer..ctor()
   at Discord.API.DiscordRestApiClient..ctor(RestClientProvider restClientProvider, String userAgent, RetryMode defaultRetryMode, JsonSerializer serializer)
   at Discord.API.DiscordSocketApiClient..ctor(RestClientProvider restClientProvider, WebSocketProvider webSocketProvider, String userAgent, String url, RetryMode defaultRetryMode, JsonSerializer serializer)
   at Discord.WebSocket.DiscordSocketClient.CreateApiClient(DiscordSocketConfig config)
   at Discord.WebSocket.DiscordSocketClient..ctor()
   at TutorialBot.Program.<RunBotAsyc>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at TutorialBot.Program.Main(String[] args)

I am not exactly sure how to handle, or fix, this issue. I have looked around for solutions, but I haven't gotten very far. Some other methods I have tried in order to run my program haven't been very successful so, if possible, I would really like to try to make this work on this OS.

1
  • You should be more specific about the non-working solutions you found or the "Some other methods" you have tried. This would make it easier for us to understand what you already know or tried or to find a mistake you might have made.
    – Bodo
    Apr 29 at 10:49

1 Answer 1

0

Make sure it was a dotnetcore console application then with CMD cd into the projects directory and run dotnet publish -r win8-arm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.