"Are you missing a using directive or an assembly reference" in visual studio 2013

73,711

Solution 1

When I got an error like this on my Environment, I do following:

  1. Clean solution in VisualStudio
  2. Close VisualStudio
  3. Delete all "bin" and "obj" Folders (from the whole solution) manually
  4. Delete "packages" Folder manually
  5. Restart VisualStudio
  6. Rebuild all

In most cases, this solves this reference-problems (in my case)

Solution 2

  • Right click on the referenced project -> Unload Project
  • Right click on the referenced project -> Edit ...
  • Add a space after any line in the file
  • Save
  • Right click on the referenced project -> Reload Project

Solution 3

It sounds like you're missing your Xamarin.Forms packages.

Can you expand your Packages directory in the Solution Explorer, and see if it's in there?


Try this :

  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

Solution 4

For me, it helped to add this line to my *.csproj:

<Reference Include="...">
    <SpecificVersion>False</SpecificVersion>
</Reference>

Solution 5

I just quit Visual Studio and started it again. The error was gone!

Share:
73,711
Jaycee Evangelista
Author by

Jaycee Evangelista

Updated on May 06, 2021

Comments

  • Jaycee Evangelista
    Jaycee Evangelista about 3 years

    Good Day everyone. I'm developing a Cross Platform Application in Xamarin.Forms when I encounter this error "Are you missing a using directive or an assembly reference". My project is working fine before I install a Nuget package (Circle Image View in Xamarin), but when I uninstall it (without changing a single line of code) the said error started to appear. I tried to Build, Rebuild it but still it does not work. Anything I can do to fix this? Any help will be appreciated. Thanks a lot.

    These are the errors:

    Error 1:

    The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)

    Error 2:

    The type or namespace name 'Application' could not be found (are you missing a using directive or an assembly reference?)

    Error 3:

    The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)

    Error 4:

    The type or namespace name 'ContentPage' could not be found (are you missing a using directive or an assembly reference?)

  • Jaycee Evangelista
    Jaycee Evangelista about 8 years
    I installed Circle Image View Sir. Yes I'm sure I don't have error in my code before I installed that.
  • Dpedrinha
    Dpedrinha over 7 years
    Visual Studio 2017 is having issues like this. This solution fixed for me. Thanks
  • Gustavo Baiocchi Costa
    Gustavo Baiocchi Costa over 6 years
    Thanks mate, spent whole day trying to find this solution. After updating Xamarin I couldnt get Resources to be recognized anymore. Went on nuget packages and there was an update from xamarin.forms. Once I updated everything worked as expected. Cant thank you enough!!!!
  • Alex
    Alex almost 6 years
    By today, it is still an issue that can be solved this way. I use Visual Studio 2017, too, and it worked for me as well.
  • Exel Gamboa
    Exel Gamboa almost 6 years
    This solution fixed my problem too! I thought that the project was lost because of all the missing references. Doing this fixed all references! :) Thank you!
  • Anup Buchke
    Anup Buchke over 4 years
    Where is the packages folder? Can you please add that explanation.
  • Joehl
    Joehl over 4 years
    @AnupBuchke It depends on how you setup your nuget-configuration. By default, there should be a packages folder in the same folder, where your solution-file '.sln' is saved. (Maybe you can check this as well: docs.microsoft.com/en-us/nuget/consume-packages/…)
  • dcalmeida
    dcalmeida over 3 years
    Thanks. Deleting packages folder worked for me