Reputation: 1221
Visual Studio seems to be having a hard time starting up, so I'm wondering if there's anything wrong in my setting it up. I'm currently using:
Setting up New Solution:
A (New Project):
B (Configure your Blank Forms App, part 1):
C (Configure your Blank Forms App, part 2):
Immediately, VS begins the Adding packages... process. After it's done, the 3 Packages folders have a variety of Xamarin-related files, one of which they all have in common: Xamarin.Forms.
Just as a test, I right-click on ABCD solution folder and select Clean ABCD. Immediately, I get hit with this:
Error XF001: Xamarin.Forms targets have been imported multiple times. Please check your project file and remove the duplicate import(s). (XF001) (ABCD)
Why is this happening? I've tried separately deleting each of the Xamarin.Forms file in each of the aforementioned 3 Packages folders, but that did nothing good.
Right-clicking on the error message and selecting Show Error Reference literally just takes me to a Google Search result page for the search term "XF001", which helps 0%.
What am I doing wrong?
Upvotes: 0
Views: 672
Reputation: 2985
Nuget might generate (for some reason) .nuget.targets
and .nuget.props
files in the project directory containing Import
statements for Xamarin.Forms in addition to the same Import
statements in the project file (<project>.csproj
).
Backup the .nuget.targets
and/or .nuget.props
files and try removing the .nuget.targets
and .nuget.props
files from the project directory.
Upvotes: 1
Reputation: 33993
I have encountered this as well. It seems like a bug in the current 'New Project' templates, at least in Visual Studio for Mac.
Go into the folder where the csproj file of your shared library is. edit it with Notepad or similar and find the <import>
node(s) at the bottom. There should be one which has something relatable to Xamarin in it. Remove this import
node, save it and open/reload your solution.
Upvotes: 1