Open thryfts opened 1 year ago
Are you sure you C# code compiles? There's missing using statements, there's the seemingly wrong function signature for getCred, it has Task<string>
has a return type but String.Split returns a string[]
Another thing I noticed is that you are using connection.On in dotnet where probably what you want is:
connection.OnAsync<string, string[]>("getCred", async (string testing) =>
{
///...
});
Second template arg is the return type which from what I can tell is what you want, an array of strings (you can also omit the template args and just use OnAsync(...)
).
Another thing that might be the cause of your issues is that warnings in dotnet go to the stdout stream, so if there are any warning when running your code like warning CS8602: Dereference of a possibly null reference.
which probably will happen on this line string cred = parsedResult.cred;
then you'll get a serialization error
when I await the data I want to send to Electron Js I get error
One or more errors occurred. (Serialisation failed for: { Type = RESPONSE, Response = ElectronCgi.DotNet.Response`1[System.Threading.Tasks.Task`1[System.String]] }.)
. Why is this error occurring? I am awaiting the response from the post request I made soSystem.Threading.Tasks.Task
shouldn't be occurring. Where did I go wrong? Thanks in advance.C#
Node Js