The type or namespace name 'Xamarin' missing error in Xamarin Studio

后端 未结 16 1563
陌清茗
陌清茗 2020-12-15 04:21

I\'m getting this error:

\"MyApp\\App.cs(7,7): Error CS0246: The type or namespace name \'Xamarin\' could not be found (are you missing a using di

相关标签:
16条回答
  • 2020-12-15 04:26

    Trivial solution to try before proceeding with more severe methods: Restart Visual Studio


    The context in my case is that the solution was already compiling previously, yet stopped doing so after changes to the code. In my case all I did was change the XAML file, add a resource and reference said resource in the XAML file. Prior to this Xamarin.Forms was found, afterwards it was no longer found by Visual Studio for an unknown reason.

    Restarting Visual Studio resolved the problem for me.

    This is likely only relevant if Xamarin.Forms was found before and suddenly went missing, a restart is obviously unsuitable in fixing errors with the project setup.

    This also sometimes (though not always) occurs when the Xamarin.Forms NuGet package is changed, i.e. a different one is installed for projects.

    0 讨论(0)
  • 2020-12-15 04:27
    • Select Solution & Right click.
    • Go to Manage Nuget packages for solution.
    • Go to updates.
    • if xamarin.forms is there, update it.

    You are ready to work with xamarin.forms :)

    0 讨论(0)
  • 2020-12-15 04:28

    Do the following:

    1. Go to Manage NuGet Packages for Solution
    2. Remove Xamarin.Forms
    3. Reinstall Xamarin.Forms
    0 讨论(0)
  • 2020-12-15 04:28
    1. Go to "Manage NuGet Packages...
    2. View in Installed Tab
    3. If Xamarine.Forms package exist, update it.
    4. If not Go to Browse tab find Xamarine.Forms and install it.
    0 讨论(0)
  • 2020-12-15 04:28

    I have VS 2019 and I was prompted to update the Android SDK. After doing this I got a load of compiler errors including The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' After updating my NuGet package to the latest version, the errors resolved (from 4.3.0.947036 to 4.3.0.991211)

    0 讨论(0)
  • 2020-12-15 04:28

    Look for your Target. Some targets aren't compatible with Xamarin.

    0 讨论(0)
提交回复
热议问题