"Are you missing a using directive or an assembly reference" in visual studio 2013
Solution 1
When I got an error like this on my Environment, I do following:
- Clean solution in VisualStudio
- Close VisualStudio
- Delete all "bin" and "obj" Folders (from the whole solution) manually
- Delete "packages" Folder manually
- Restart VisualStudio
- 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 :
- Select the project in the
Solution
tab - Select
Project
along the top menu - Select
Add Nuget Packages
... - Do a search for
Xamarin.forms
- 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!
Jaycee Evangelista
Updated on May 06, 2021Comments
-
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 about 8 yearsI installed Circle Image View Sir. Yes I'm sure I don't have error in my code before I installed that.
-
Dpedrinha over 7 yearsVisual Studio 2017 is having issues like this. This solution fixed for me. Thanks
-
Gustavo Baiocchi Costa over 6 yearsThanks 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 almost 6 yearsBy 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 almost 6 yearsThis 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 over 4 yearsWhere is the packages folder? Can you please add that explanation.
-
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 over 3 yearsThanks. Deleting packages folder worked for me