Closed Suplanus closed 5 years ago
Q42.HueApi works fine with .Net Core and is used in multiple .Net Core apps.
I had a look at your code and your static Main is not async. A lot of Q42.HueApi's are async, so you should await them.
You are not awaiting the muteToHue.StartAsync()
in Program.cs
This should help:
static async Task Main(string[] args)
{
Console.WriteLine("MuteToHue started");
try
{
MuteToHue muteToHue = new MuteToHue();
await muteToHue.StartAsync();
}
catch (Exception ex)
{
Console.WriteLine("Error: " + Environment.NewLine + ex);
}
}
🤦♂️ Sorry my fault.
Thanks for your help!
Hi,
i created a simple .NET Core project. If i call
HttpBridgeLocator.LocateBridgesAsync
orLocalHueClient.RegisterAsync
the program crashes without an exception.Made a project here for you to reproduce the problem: https://github.com/Suplanus/Suplanus.MuteToHue/blob/594a45040750dba876182bc158f65450055ffe5b/src/Suplanus.MuteToHue/MuteToHue.cs#L24
I tried also to remove the locater code and set the ip address manually.