简体   繁体   中英

Miscellaneous files in C#/Xamarin.Forms Shared Project

All .cs file in my Xamarin project are Miscellaneous files http://prntscr.com/cp3q4w . I have no Quick Actions and Refactorings support, and it seems like there is somehow missing reference to Xamarin.Forms http://prntscr.com/cp3qzr ,but i dont get compile error for not recognizing xamarin components. This is Xamarin.Forms Shared project.

Tried with this solution: i) Clear the cache ii) Open the solution iii) Unload all projects iv) Load Android project and then fix nuget references v) Once the references were fixed, I loaded the shared project. Now everything seems to work. But, didn't succeed.

Anyone had similar problem? Any suggestions for solution? Thanks.

First thing to try if your solution is checked in to source control:

If this fails, try this:

  • Starting a new Visual C# -> Cross Platform -> Mobile App (Xamarin.Forms) solution in Visual Studio 2017. I recommend trying a ".NET Standard" project rather than a "Shared Project".

  • Make sure the solution compiles and runs to make sure you have all the necessary components for Xamarin Installed.

  • Do a back up of this clean solution, or commit it to source control.

  • Upgrade all the NuGet packages if necessary

  • Pull all the files in from your old solution and see if you get the same problem. Just remember to make sure that the files are added as the correct type of file. For example xaml files must be set to "Embedded resource".

If you still have trouble, please post the error that you get, and upload your solution somewhere so we can have a look.

This also happened to me. It still does every now and again.

These steps work for me:

  1. Close your solution.
  2. Delete the packages folder from your solution folder or just rename it to packages.old
  3. Open your solution and restore the NuGet packages.
  4. The new class will now show up correctly and your intellisense should work again.

Does anyone have an idea what could cause this though as I don't see any errors when building?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM