When I try to create a new Xamarin Forms app, nothing works. No imports can be found. Almost every line in the autogenerated code has a "not found" error.
Visual Studio Enterprice 2019
I've tried to update the packages in nuget packages manager. Refreshed renewed and reinstalled VS2019 + all .net framworks
In addition updated in PMC (Package Manager Console) and typed:
Hello,
Welcome to our Microsoft Q&A platform!
Firstly, please close your VS. then open you project folder, delete all
bin
and
obj
folders(projectName folder , projectName.Android folder,projectName.iOS folder), then open your project, rebuild it, if this issue is disappeared.
If no. please open the VS installer, click repair function.
Best Regards,
Leon Lu
If the response is helpful, please click "
Accept Answer
" and upvote it.
Note: Please follow the steps in our
documentation
to enable e-mail notifications if you want to receive the related email notification for this thread.
Hello,
Thanks for your prompte answer.
Did some browsing yesterday, and found Xamarin is to be replaced in full by this new tech .NET MAUI.
Thus I've decided to jump off the "Xamarin Train", so, it's all over now, right before we started.
I do remember having huge problems with this in a previous 300+ hour WPF plugin project.
The only way to fix it was getting an in house expert to identify and add a ton of references manually.
I am therefore rather puzzled and slightly concerned about the MS approach using explicit nuget packages for various solutions.
To be fair I had no problems whatsoever with a rather advanced 2000 hour MS C# asp.net app project.
I know it works if its done right but these references should preferrably work out of the box by a warning
at the using ... and having visual studio installing the package automagically. Or installed manually with a right-click, install package option IMO.
Anyway, thanks for the help.
Regards
Brage
Reinstalling etc did not help me.
What did help:
my project name / git repository path had a space in it.
It was "Some Name" / "Some%20Name" -- changing the project name / path to "somename" or "some_name" cured this.
Spaces in filenames / paths can mess up things in mysterious ways, best not to have them.
We have spaces in our paths all the time. This wouldn't cause issues with the compiler as the filename itself is only needed as a parameter to the compiler. The compiler never sees it. There is something else going on here but without a reliable way to replicate it is hard to tell what. Provided your problem is solved then I won't worry about it.