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

后端 未结 16 1564
陌清茗
陌清茗 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:33

    I just had to add the Xarmin.Forms.Addin.dll in app's references. :) (Thanks @sam holder your hint in the comments led me to the answer.)

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

    MihaMarkic's post here led me to the right answer. For each project in your solution you'll need to do the following:

    1. Select the project in the Solution tab
    2. Select "Project" along the top menu
    3. Select "Add Nuget Packages..."
    4. Do a search for "Xamarin.forms"
    5. Add "Xamarin.forms" to that project

    This is the workflow that got it working on my Mac. I'm not sure what the exact steps are for you PC users out there.

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

    I had it today in the VS MAC.

    Deleting the ".vs" hidden folder fixed it for me.

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

    Do the following

    1. Install latest Microsoft .NET Portable Library Reference Assemblies.
    2. Extract the file in "C:\Program Files\Microsoft .NET Portable Library Reference Assemblies 4.6\PortableReferenceAssemblies.zip" to "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable" in 64bit and "C:\Program Files\Reference Assemblies\Microsoft\Framework.NETPortable" in 32 bit

    3.Go to control panel select programs and features and right click xamarin choose repair. 4. Start xamarin studio again.

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

    I have to combine some previous answers:

    • Reinstall Nugets (Xamarin.Forms)
    • Restart VS2019
    0 讨论(0)
  • 2020-12-15 04:39

    This happened when I removed the Xamarin.Android.Support.v4 and Xamarin.Forms library in order to downgrade to an earlier version. I got it working again by resetting the Droid packages.config to:

    <?xml version="1.0" encoding="utf-8"?>
    <packages>
      <package id="Xamarin.Android.Support.v4" version="22.1.1" targetFramework="MonoAndroid44" />
      <package id="Xamarin.Forms" version="1.4.2.6355" targetFramework="MonoAndroid44" />
    </packages>
    

    Then right-click the Droid Packages folder to Restore missing packages. The final step is to add the References > From Packages to the *.Droid.csproj

    <Reference Include="Xamarin.Android.Support.v4">
      <HintPath>..\packages\Xamarin.Android.Support.v4.22.1.1\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll</HintPath>
    </Reference>
    <Reference Include="Xamarin.Forms.Platform.Android">
      <HintPath>..\packages\Xamarin.Forms.1.4.2.6355\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
    </Reference>
    <Reference Include="FormsViewGroup">
      <HintPath>..\packages\Xamarin.Forms.1.4.2.6355\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
    </Reference>
    <Reference Include="Xamarin.Forms.Core">
      <HintPath>..\packages\Xamarin.Forms.1.4.2.6355\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
    </Reference>
    <Reference Include="Xamarin.Forms.Xaml">
      <HintPath>..\packages\Xamarin.Forms.1.4.2.6355\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
    </Reference>
    <Reference Include="Xamarin.Forms.Platform">
      <HintPath>..\packages\Xamarin.Forms.1.4.2.6355\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
    </Reference>
    
    0 讨论(0)
提交回复
热议问题