zorous
✅ getting error using http client
private async Task getGameStatus()
{
using (HttpClient client = new HttpClient())
{
try
{
HttpResponseMessage response = await client.GetAsync("https://game-website/activePlayers");
if (response.IsSuccessStatusCode)
{
string responseContent = await response.Content.ReadAsStringAsync();
DateTime currentTime = DateTime.Now;
string dayOfWeek = currentTime.ToString("dddd", CultureInfo.InvariantCulture);
int hour = currentTime.Hour;
if (dayOfWeek == "Friday" && hour >= 17)
{
GameStatus = "Updating";
}
else
{
GameStatus = "Online";
}
}
else
{
GameStatus = "Offline";
}
}
catch
{
GameStatus = "Offline";
}
}
}
private async Task getGameStatus()
{
using (HttpClient client = new HttpClient())
{
try
{
HttpResponseMessage response = await client.GetAsync("https://game-website/activePlayers");
if (response.IsSuccessStatusCode)
{
string responseContent = await response.Content.ReadAsStringAsync();
DateTime currentTime = DateTime.Now;
string dayOfWeek = currentTime.ToString("dddd", CultureInfo.InvariantCulture);
int hour = currentTime.Hour;
if (dayOfWeek == "Friday" && hour >= 17)
{
GameStatus = "Updating";
}
else
{
GameStatus = "Online";
}
}
else
{
GameStatus = "Offline";
}
}
catch
{
GameStatus = "Offline";
}
}
}
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (timeapi.io:443)
The program '[34060] Blade Guns.exe' has exited with code 4294967295 (0xffffffff).
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (timeapi.io:443)
The program '[34060] Blade Guns.exe' has exited with code 4294967295 (0xffffffff).
56 replies
Installed Entity framework SQLite but getting this error in console
C:\Users\summi\source\repos\HHR Essentials\obj\HHR Essentials.csproj.EntityFrameworkCore.targets(4,5): error MSB4006: There is a circular dependency in the target dependency graph involving target "GetEFPr
ojectMetadata". [C:\Users\summi\source\repos\HHR Essentials\HHR Essentials.csproj]
Unable to retrieve project metadata. Ensure it's an SDK-style project. If you're using a custom BaseIntermediateOutputPath or MSBuildProjectExtensionsPath values, Use the --msbuildprojectextensionspath option.
C:\Users\summi\source\repos\HHR Essentials\obj\HHR Essentials.csproj.EntityFrameworkCore.targets(4,5): error MSB4006: There is a circular dependency in the target dependency graph involving target "GetEFPr
ojectMetadata". [C:\Users\summi\source\repos\HHR Essentials\HHR Essentials.csproj]
Unable to retrieve project metadata. Ensure it's an SDK-style project. If you're using a custom BaseIntermediateOutputPath or MSBuildProjectExtensionsPath values, Use the --msbuildprojectextensionspath option.
dotnet ef migrations add InitialCreate
83 replies