Xamarin.Forms UWP missing references - xamarin

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

Related

Unity keeps removing log4net from my Visual Studio project

I tried to install log4net for use in my Unity project with the following command :
Install-Package Unity.log4net
However, when I go back to the editor, then back to Visual Studio again, the log4net reference is removed, just like the Unity Editor had regenerated the project or something like that. The log4net reference no longer appears in the reference list and thus the log4net namespace can no longer be found.
I'm using Visual Studio 2017 Community Edition.
Has anyone experienced that and found a solution ? Thanks !
It seems like one cannot freely add references to a Unity project since Unity has to know about them. DLLs should be placed in a folder of the project called Plugins and then it works.
However it's weird that people are telling to use nuget packages. I'm assuming that must work somehow, but I don't know how. The solution above is dirty, but at least it works.
Unity projects require a special process to add NuGet packages. This is because when you open a project in Unity, its Visual Studio project files are regenerated, undoing necessary configurations. To add a package from NuGet to your Unity project you can check this doc from Microsoft: https://learn.microsoft.com/zh-cn/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2019

New Xamarin.Forms Project Missing References

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.

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

Having trouble installing Prism in Xamarin

When I try to install Prism in my Xamarin application in visual studio I get this error
"[nuget.orgUnable to load the service index for source http://prism.azureedge.net/main.mrep. The content at 'http://prism.azureedge.net/main.mrep' is not a valid JSON object. Unexpected charater encountered while parsing value: <.Path ", line 0, position0.]"
I can't say I'm entirely sure what you're doing, but let me try to clarify some things for you.
The URL http://prism.azureedge.net/main.mrep is ONLY meant to be added as an Extensions Repository Source for Visual Studio Mac. It has nothing to do with NuGet and is not compatible with any other version of Visual Studio. That feed provides the Visual Studio Mac Extension to provide the Prism Project & Item Templates as well as several code snippets.
If you are looking for the Prism CI Feed to take advantage of the latest Prism build you need to add https://www.myget.org/F/prism/api/v3/index.json as a NuGet Package Source.

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