New Xamarin.Forms Project Missing References - xamarin

I have created a brand new Xamarin.Forms project, targeting iOS, in Visual Studio for macOS, and when I try to build I get the following errors, in AppDelegate.cs, about missing assembly references.
I have tried adding references, but I am presented with a blank window.
I also tried updating all NuGet packages, since I found an SO answer which suggested this might resolve the issue, but I'm still having the same problems.
This is my first experience of trying to use Xamarin, and so I really have no idea what I'm supposed to do or what references the project requires to be able to build.
The following are all the dependencies the template project starts out with.
Does anybody know what it is that's missing? How can I get this working? I have XCode 9.3 installed, and Visual Studio is up to date, so that shouldn't be an issue I don't think.
The following image shows the structure of the two projects created when I ran the wizard to generate the new Xamarin.Forms solution.

Related

Add Reference is missing in Visual Studio when using with Unity 3D - Need Npgsql.dll

I installed Unity 2017 with Visual Studio 2017. I am attempting to add an external DLL to the Visual Studio project through the solution explorer. When I right click on References, the "Add Reference" option is completely missing!
I'm trying to use NpgSQL. Hence, the need to add npgsql.dll.
Can anyone give light?
The Add Reference... is in a different place in this case.
Things to do in Unity:
Create a folder named Plugins as a child to your Assets folder. (Assets\Plugins...)
Next copy your DLL to this plugins folder. You can do this using Windows Explorer or just drag it into the folder in the Unity editor, like shown:
Things to do in Visual Studio:
Click on Analyzers in your project as shown below, then click Project from your menu, then navigate to Add Reference...:
Now Browse to your DLL:
And... there it is:
Accepted Brien's answer (Thank you, Brien!).
I'm adding my own answer pertinent to Npgsql.dll, because it's apparently a common problem all over the internet with poor documentation. If you got here from google about Npgsql.dll then read on:
Unity (for some unknown reason) comes bundled with it's own npgsql.dll inside of the application mono/2_0 folder. Some people have reported conflicts with this.
Many of the npgsql.dll versions currently do not work with Unity. Attempting to include them in Unity's assets will cause Unity to throw a Type error. This is what caused me to think that I needed to add the file as a reference in C#. This is why I came here and asked the question about Add Reference. But, with Unity, this was simply wrong on my part.
As far as I can tell, Unity insists on managing all project properties and references for you. Both managed and unmanaged DLLs must be added via Unity assets. Even Visual Studio project properties cannot be changed within Visual Studio for Unity. And if you attempt to edit the .csproj files (for instance to disable compiler warnings), Unity will overwrite the .csproj files completely next time you load your Unity project.
Anyone who has problems getting Npgsql.dll to work in Unity needs to use the proper Unity workflow where you drop npgsql.dll into Unity assets. If you get errors, it's an npgsql.dll version conflict. Try other versions of the dll first.
This gentleman has provided a Unity specific build to resolve a namespace conflict (Just pull the dll from the bin folder on the Github link):
Unity NPGSQL.DLL
Unity 2017 currently allows you to change to .NET 4.6 as an experimental setting. Some people have toyed with using that setting to get newer versions of npgsql.dll to work properly, but they report intermittent results. For now, I solved my problem with Unitynpgsql.dll. It's an older build, so hopefully I won't run into any features I need that it doesn't support. If so, I'll probably just work around them.
To anyone else trying to make npgsql.dll work in Unity: do not despair, just try to resolve the version conflicts. Also here is another relevant recent thread about it:
Barebones Master Server Npgsql.dll Issue - January 2018

Error creating a new MonoGame project from Xamarin Studio

I was trying out MonoGame. I installed the MonoGame add-in, and then created a new Universal Project. Looked good.
Then I noticed that both the Mac and Android projects created had bad references to a MonoGame assembly. Some googling revealed this is a known issue, and I was able to remove the bad reference and add the correct one.
But now when I build, I get an error:
Error: /Users/davevr/Documents/github/MonoTestGame/iOS/MonoTestGame.iOS.csproj could not import "$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets"
I can't find these files anywhere on my machine so I am not sure what the issue is.
Any help would be appreciated!
Did you install the MacOS download?
http://www.monogame.net/2016/03/17/monogame-3-5/
It should install those targets to your machine. It might also be possible that the project templates are old and do not correctly reference the right paths.

Xamarin.Forms failed to compile android project with "Droid.Resource.Attribute" does not contain a definition for "actionBarSize"

I have a Xamarin.Forms project, and it worked just fine until I updated my Xamarin Studio Community to latest 5.10.3 (build 51) and updated Xamarin.Forms to 2.2.0.31
When I compile my android project, it showed me
"mynamespace.Droid.Resource.Attribute" does not contain a definition for "actionBarSize"
I did not change anything after upgrade and it works before, I know some others faced the same problem like me when I search on google, seems no one asked this in stackoverflow yet so I would like to get some help here.
If the above doesn't work try this
1) Delete Bin and Obj folders in project folder
2) Delete contents of C:\Users{your username}\AppData\Local\Xamarin\zips
3) Rebuild project
*This will take a while because xamarin will re-download the required files. it should work after its done.
That's a bug listed here. There are different workarounds about this, please try:
Failed to use Android Support Library v4
Creating a Hello World in Visual Studio with Xamarin Forms Fails
Xamarin cross-platform (portable class) project compilation error

Xamarin.Forms UWP missing references

When I create a new project in Xamarin.Forms I get a lot of errors in the UWP part of the project.
It looks like I miss all the referencs in UWP?
I installed Xamarin trough Visual Studios modify
Below is a screenshot of my Visual Studio
I also started to work with Xamarin about two weeks ago and came across many problems and one was just like yours. If you dont have Xamarin studio go and download it. Just do it.
Intellisense breaks really often and you get 200 errors that are dump(or not).
To get rid of the errors there are many ways.
Sometimes you just have to wait.
Open the xaml pages and save them.
Clean - rebuild the project it should run(at third try). If it doesnt you have to open Xamarin studio and built it from there.
If your project is new, just delete it and create a new one.
If you have MVC 5 or Core 1 Installed you will have to remove them(if that doesnt help do a PC Reset like a format).
If it says something for .zip files, find them keep a backup and delete them. Xamarin will re-download on Build.
I had same problem here using Visual Studio 2015 Update 2. Unload the UWP and everything works.
Tried in Xamarin Studio Professional and the following error: -
Could not load project 'blah\blah.UWP\blah.UWP.csproj' with unknown item type '{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A}'
The following link has some helpful points and mentions "UWP is available in Xamarin.Forms 2.1 and later"
https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/
The default setup when creating a new project in VS 2015 Up2 is to use Xamarin Forms v2.0.0.6482, however when I try to update to v2.1.0.6529 I get nuget errors
Checking my output when trying to update to 2.1 using nuget i got the following: -
The content at 'https://{myteamcityserver}/guestAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.UniversalWindowsPlatform'' is not valid XML.
Root element is missing.
So I turned of my local Package Source in Tools | NuGet Package Manager | Package Manager Settings | Package Sources
And woo hoo it all worked for me.
Regards
Peter

Can not reference System.data Error when creating project

I am using Visual Studio 2015 Enterprise to generate Coded UI Tests. Things have been working well until this morning. When I attempt to create a new Solution/Project, I am given the following error:
I am then able finish loading the project. However, I see another issue in solution explorer:
Note that there is no path given for the selected reference. If I try to remove it/add it back as a reference manually, I still do not see a path or version. I have tried the following:
Selected different .Net framework versions when creating the solution/project
Tried different project types: Window Forms, Class Library
Repaired visual studio
Repaired .Net Framework 4.6.1
So far I have been unable to make the error go away. Any other suggestions?
I was not able to resolve this issue. I ended up performing a reinstall of the OS/Visual Studio to get things working again.

Resources