C# 找不到系统,Xamarin。找不到表单

C# 找不到系统,Xamarin。找不到表单,c#,xamarin,xamarin.forms,xamarin.android,xamarin.ios,C#,Xamarin,Xamarin.forms,Xamarin.android,Xamarin.ios,严重性代码说明项目文件行抑制状态 错误CS0246找不到类型或命名空间名称“System”(是否缺少using指令或程序集引用?)Beer Garden1 C:\Users\henry\source\repos\Beer Garden1\Beer Garden1\Beer Garden1\ViewModel\LoginViewModel.cs 3 Active 严重性代码说明项目文件行抑制状态 错误CS0246找不到类型或命名空间名称“Xamarin”(是否缺少using指令或程序集引用?) 我

严重性代码说明项目文件行抑制状态 错误CS0246找不到类型或命名空间名称“System”(是否缺少using指令或程序集引用?)Beer Garden1 C:\Users\henry\source\repos\Beer Garden1\Beer Garden1\Beer Garden1\ViewModel\LoginViewModel.cs 3 Active

严重性代码说明项目文件行抑制状态 错误CS0246找不到类型或命名空间名称“Xamarin”(是否缺少using指令或程序集引用?)

我目前收到上述错误,不确定原因。我花了几个小时浏览了堆栈溢出和google,但什么都没用

清理解决方案、重建、构建和重新加载未起作用

修复visual studio不起作用

我被难住了,请帮忙,我们将不胜感激

using Beer_Garden1.Services;
using Beer_Garden1.View;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using Xamarin.Forms;

namespace Beer_Garden1.ViewModel
{
    public class LoginViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
    public Command cmdLogin { get; set;  }
    public Command cmdCreateAccount { get; set; }
    public Command cmdForgotPassword { get; set; }
    public Command cmdSetting { get; set; }

    ILoginService ilog = DependencyService.Get<ILoginService>();

    public LoginViewModel()
    {
        cmdLogin = new Command(gotoMainPage);
        cmdCreateAccount = new Command(gotoCreateAccount);
        cmdForgotPassword = new Command(gotoForgotPassword);
        cmdSetting = new Command(gotoSetting);
        
    }

    private void gotoSetting(object obj)
    {
        App.Current.MainPage.Navigation.PushAsync(new SettingPage());
    }

    private void gotoForgotPassword(object obj)
    {
        App.Current.MainPage.Navigation.PushAsync(new ForgotPasswordPage());
    }

    private void gotoCreateAccount(object obj)
    {
        App.Current.MainPage.Navigation.PushAsync(new CreateAccountPage());
    }

    private void gotoMainPage(object obj)
    {
        if (ilog.login(UserName, Password))
        {
            App.Current.MainPage.Navigation.PushAsync(new MainPage());
        }
        else
        {
            LoginMessage = "Please enter a valid user name and password!";
            TurnLoginMessage = true;
        }

    }
    //-------------------------------------------------------------
    private string userName;
    public string UserName
    { get 
        { 
            return userName; 
        } 
        set 
        { 
            userName = value;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("UserName"));
        } 
    }

    private string password;
    public string Password
    {
        get
        {
            return password;
        }
        set
        {
            password = value;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Password"));
        }
    }

    private string loginMessage;
    public string LoginMessage
    {
        get
        {
            return LoginMessage;
        } set
        {
            loginMessage = value;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LoginMessage"));
        }
    }

    private bool turnLoginMessage = false;
    public bool TurnLoginMessage
    {
        get
        {
            return turnLoginMessage;
        }
        set
        {
            turnLoginMessage = value;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("TurnLoginMessage"));
        }
    }
}

我最终解决了我的问题,我从
%appdata%
中删除了NuGet文件夹,然后在VS启动时以其默认值重新创建,我只需运行NuGet软件包还原,它就删除了我所有的98个错误和13个警告

我希望这对运行相同问题的任何人都有用,因为我自己在网上很难找到解决方案


谢谢大家的帮助

您是否恢复了NuGet软件包?
使用系统我还原了NuGet packeges,但它没有做任何事情。我正在使用xamarin.forms和systemEdit向您显示文件,此错误不仅出现在该文件上,而且出现在整个项目中,此外,此错误在新服务器上仍然存在projects@Jason这是我在尝试还原NuGet软件包时收到的错误还原NuGet软件包时发生的
错误:无法从远程源检索有关“NETStandard.Library”的信息https://packagesource/FindPackagesById()?id='NETStandard.Library'&semVerLevel=2.0.0'
NU1603: Beer Garden1.iOS depends on Xamarin.Forms (>= 4.8.0.1451) but Xamarin.Forms 4.8.0.1451 was not found. An approximate best match of Xamarin.Forms 5.0.0.2012 was resolved.
NU1102: Unable to find package System.Numerics.Vectors with version (>= 4.5.0)
  - Found 2 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.1.1 ]
NU1603: Beer Garden1.Android depends on Xamarin.Essentials (>= 1.5.3.2) but Xamarin.Essentials 1.5.3.2 was not found. An approximate best match of Xamarin.Essentials 1.6.1 was resolved.
NU1603: Beer Garden1.Android depends on Xamarin.Forms (>= 4.8.0.1451) but Xamarin.Forms 4.8.0.1451 was not found. An approximate best match of Xamarin.Forms 5.0.0.2012 was resolved.
NU1102: Unable to find package System.Numerics.Vectors with version (>= 4.5.0)
  - Found 2 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.1.1 ]
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
Time Elapsed: 00:00:00.1797576