Lachee / discord-rpc-csharp

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

Program.cs #39

Closed DopeDealers closed 6 years ago

DopeDealers commented 6 years ago

error DiscordRPC.dll'. Cannot find or open the PDB file.

i have the pdb file within the output folder

this is my program.cs file

`class Program { public static DiscordRpcClient client;

    static void Main(string[] args)
    {
        client = new DiscordRpcClient("id", true, 1);

        //Subscribe to events
        client.OnPresenceUpdate += (sender, e) =>
        {
            Console.WriteLine("Received Update! {0}", e.Presence);
        };

        //Connect to the RPC
        client.Initialize();

        //Set the rich presence
        client.SetPresence(new RichPresence()
        {
            Details = "csharp example",
            State = "csharp example",
            Assets = new Assets()
            {
                LargeImageKey = "removed",
                LargeImageText = "removed",
                SmallImageKey = ""
            }
        });
        Console.ReadLine();
    }
}`

i dont have any idea what the problem is

Kind regards, Phil

ghost commented 6 years ago

Did you forget to import the dll?

DopeDealers commented 6 years ago

I did not forget to import it, Thats why i was so confused

ghost commented 6 years ago

Can you send output of when you try to compile it?

DopeDealers commented 6 years ago

The error i posted above was the only thing that outputted during comp

Along with the fact it still didnt work lol (edit)

ghost commented 6 years ago

So basically. Discordrpc.dll cant find the PDB file.

A PDB file is generated by the compiler and contains debugging information. (Source)

It looks for a PDB file But cant find one.

It might be a problem with the compiler you use or the dll.

Possible fixes: • Recompile the DiscordRPC dll • Delete the PDB file. The compiler should make a new one If none of the above works: • Use another compiler

If you dont want to use another compiler you can send the contents of the PDB file after compiling

DopeDealers commented 6 years ago

hmm, question. when compiling do i throw the PDB file into my projects debug bin/ where it builds or am i getting that wrong

ghost commented 6 years ago

Dont move the PDB. Dont do anything to the PDB just let it be and follow the instructions on my previous reply

DopeDealers commented 6 years ago

Yes the PDB Generates, but im using a seperate project with the DLL and it gives me that error, sorry if i sound kind of like a dunce.

ghost commented 6 years ago

Please send the contents of the PDB then

DopeDealers commented 6 years ago

May i just send you the PDB as i cant open it as of now

ghost commented 6 years ago

Ok

DopeDealers commented 6 years ago

PDB-DLL.zip ive also included the drpc dll just incase

ghost commented 6 years ago

Ok. Sorry But you have to Wait like 4 hours. Im at school

DopeDealers commented 6 years ago

yeah thats fine, thank you for helping me

ghost commented 6 years ago

Nvm i managed to do it now. Did you compile the dll from the native discord Rpc library?

DopeDealers commented 6 years ago

no i only used the build script

DopeDealers commented 6 years ago

https://gyazo.com/a90c2cdffff10d138334c28ae2127453

Im assuming from native rpc library you mean discordapps rpc lib?

ghost commented 6 years ago

Try to compile the dll with visual studio. Not with the build script. And do not use the native one

DopeDealers commented 6 years ago

alright, ill update you once i compile

ghost commented 6 years ago

this is the native Discord RPC library. Do Not use it

DopeDealers commented 6 years ago

Ok, compiling from VS seems to have fixed the PDB issue but now alot of my other libs i used that didnt come with a PDB and worked before without it arent working,

Thats not your end tho so ill go ahead and close this. thank you for helping me

ghost commented 6 years ago

I would be glad to help you further :) What libraries arent working?

DopeDealers commented 6 years ago

It seems it was a common problem with the libs i used, BUT i ran the app i compiled and its still only showing up as an un-rpc application

here

Fixed it, my ID was screwed up! Thank you so much for the help, have an amazing day

DopeDealers commented 6 years ago

I have one more question just so i dont have to open any more issues etc,

this ones not that important so i dont mind waiting awhile thanks again for earlier

ghost commented 6 years ago

whats the question?

DopeDealers commented 6 years ago

Sorry for the very late reply, but If i set the RPC inside of the init class etc.

How would i set the details of the RPC and state when a user clicks a button

this is the new rpc thing im using

private static RichPresence presence = new RichPresence() { Details = "", State = "", Assets = new Assets() { LargeImageKey = "icon", LargeImageText = "temp", SmallImageKey = "temp", SmallImageText = "temp" } };

edit: i checked the example rpc client and it worked when i tried that, have a great day hampusm!