Lachee / discord-rpc-csharp

C# custom implementation for Discord Rich Presence. Not deprecated and still available!
MIT License
579 stars 96 forks source link

Could not load file or assembly 'Newtonsoft.Json #36

Closed showengineer closed 6 years ago

showengineer commented 6 years ago

34 reopen, I have the same problem.

Newtonsoft.Json.dll is present in the netcoreapp2.0 folder (I use .NET Core).

Console output: Running... INFO: Attempting a new connection INFO: Initializing Thread. Creating pipe object. INFO: Connecting to the pipe through the DiscordRPC.IO.ManagedNamedPipeClient INFO: Attempting to connect to discord-ipc-0 INFO: Waiting for connection... INFO: Connected to discord-ipc-0 INFO: Begining Read of 16384 bytes INFO: Connected to the pipe. Attempting to establish handshake... INFO: Attempting to establish a handshake... INFO: Sending Handshake... ERR : Unhandled Exception: System.IO.FileNotFoundException ERR : Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Het systeem kan het opgegeven bestand niet vinden. ERR : at DiscordRPC.IO.PipeFrame.SetObject(Object obj) at DiscordRPC.IO.PipeFrame..ctor(Opcode opcode, Object data) in C:\Users\hugow\Documents\discord-rpc-csharp-master\Discord RPC\IO\PipeFrame.cs:line 49 at DiscordRPC.RPC.RpcConnection.EstablishHandshake() in C:\Users\hugow\Documents\discord-rpc-csharp-master\Discord RPC\RPC\RpcConnection.cs:line 633 at DiscordRPC.RPC.RpcConnection.MainLoop() in C:\Users\hugow\Documents\discord-rpc-csharp-master\Discord RPC\RPC\RpcConnection.cs:line 238

showengineer commented 6 years ago

Bottomline: It can't find the DLL

Lachee commented 6 years ago

It maybe included in the folder, but is it a reference in your visual studio solution? Best way to install Newtonsoft.JSON is through the NuGet Package Manager. If you added the assembly directly, make sure Copy Local is Yes under the properties.

I have a working copy of this library running on DiscordRPC and the latest version of Newtonsoft.JSON on the .NET Core, so it seems to be your solution. It certainly seems like it cannot find the JSON library which would suggest improper setup.

showengineer commented 6 years ago

Thank you! I just downloaded the NuGet Package and it worked afterwards.