Я написал консольное приложение в .NET Core для Linux. Когда я пытаюсь запустить его на моем Linux-VPS, он выдает эту ошибку:
Could not resolve type with token 01000010
at Lumo.Program.Main (System.String[] args) [0x00039] in <dff92c70c42444648f6bf1be28aa709c>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not resolve type with token 01000010
at Lumo.Program.Main (System.String[] args) [0x00039] in <dff92c70c42444648f6bf1be28aa709c>:0
вот мой основной код C #:
string city;
Console.WriteLine("lolyweather");
Thread.Sleep(1000);
Console.Write("Enter your city: ");
city = Console.ReadLine();
string link = "https://api.openweathermap.org/data/2.5/weather?q=" + city + "&appid=" + API_KEY + "&units=metric&cnt=6";
GetWeather(link, city);
и вот функция GetWeather:
public static void GetWeather(string url, string city)
{
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
httpWebRequest.Method = "GET";
try
{
using (WebResponse response = httpWebRequest.GetResponse())
{
HttpWebResponse httpResponse = response as HttpWebResponse;
using (StreamReader reader = new StreamReader(httpResponse.GetResponseStream()))
{
var json = reader.ReadToEnd();
var obj = JsonConvert.DeserializeObject<WD.RootObject>(json);
WD.RootObject weather = obj;
Console.WriteLine("There are " + weather.weather[0].main.ToString() + " in {0}", city);
Console.WriteLine("There are {0} \u00B0C.", Math.Round(weather.main.temp));
Console.WriteLine("Max temperature: {0}, Minimum temperature: {1}", Math.Round(weather.main.temp_max), Math.Round(weather.main.temp_min));
}
}
}
catch (Exception ex)
{
Console.WriteLine($"Program crashed: {ex.Message} (Check if you wrote your city's name correctly!)");
Thread.Sleep(1_000);
}
}
Кто-нибудь знает, что случилось?