I'm newbie in Xamarin. I'm using the latest stable version of Xamarin (6.1.4) on my MAC.
I created a Xamarin.Forms project (Forms App) PCL type of project, I checked the IPhone only (Portrait only). It created 3 projects....
ProjectX
ProjectX.iOS
ProjectX.Droid
Now I like to add some .NET assemblies in my ProjectX project to use the webservice or any other .NET assembly like System.Data, system.web.webservice but the strange thing is the list is EMPTY...
e.g. How to add System.Web.Webservices in this ProjectX project?
Related
I have a Xamarin.Forms project targeting iOS and Android. In a shared netstandard library which is referenced by the iOS and Android project i would like to use a specific NuGet PackageReference based on the on the platform the library is referenced by. The problem is that because of my project structure i cannot multi-target the netstandard project - is there a way to achieve such a scenario without adding multiple TargetFrameworks to the head project?
Could this condition be done with custom configurations i.e. Debug | iOS or Debug | Droid
In Visual Studio 2017, a fresh new Xamarin solution is created with Portable Class Library.
A initial build shows success. But a run gives an error message:
warnings like
Unable to add a reference to project 'App1'. The current project's target is not one of or compatible with the targets of Portable Library project 'App1'.
It is in both App1.iOS and App1.Android.
I have not yet upgrade the Xamarin NuGet package yet. The UWP project can run without any warning or exception.
Look into the project reference on the Android project, we see the broken reference to App1.
Trying to reference that PCL project again, I got
Look into the Property of the App1 PCL project,
What could be wrong? How can I fix the PCL project so it can be correctly referenced by Android and iOS projects?
Brand new install of Visual Studio Pro 2017, Prism Template Pack, and Xamarin Forms.
I am trying to create my first App and things are going very well so far. I have all the views, view models, etc. set and the app is functioning perfectly. Now I am trying to add some more PCL projects to the solution for things like Domain or Services, etc. so I can keep all the parts separated.
I can create a Xamarin Forms PCL just fine and add all my classes, etc. Problem comes when I try to add a reference to the Domain project from the main PCL project in the solution. I get the "targets of pcl don't match" error message.
This is what I am using to create the new PCL project:
This is the error message I receive when trying to add the PCL project reference:
What am I missing?
Here is the main PCL created with the template pack properties:
Here is the newly added PCL project properties:
PCL properties for template:
Since you are missing the Windows Phone & Silverlight targets in your IDE for some reason, this is a potential workaround:
Open up your .csproj files and make sure the TargetFrameworkProfile elements match up in both PCL projects.
Is it possible that you didn't install the tools for Windows Phone development when you installed Visual Studio?
I have a Xamarin Android project, and I am trying to add a reference to my own netstandard1.4 class library. When I add the reference, my Android application will no longer build. I get error MSB4057: The target "GetBuiltProjectOutputRecursive" does not exist in the project.
If I remove the reference, my android project builds fine.
The class library is a brand new library that I just created. It doesn't contain any actual code yet.
I am using Visual Studio 2017.
UPDATE: If I add a reference to my dll using the "Browse" function, it works. I only get the error when I add the reference to the project in my solution.
This appears to be fixed in 15.4
I'm running Visual Studio 2015 Update 3. I chose to create a .Net Core Project with .Net framework option specifically to use MVC 6. I have some classes in the project that I would like to reference from a console application project that I have included in the same solution. Although I can successfully add a reference to the .Net Core Project from the Console App, when I try to use the class from the console app, i'm unable to successfully add a using statement. It was my understanding that using the project template .Net Core App "With Net Framework" would prevent such issues. I've seen other posts regarding csproj xproj incompatibility. But i'm trying to add the reference from one xproj to another xproj. Is this even supported anymore? What a mess.
FYI: I also disabled resharper.
add the reference from one xproj to another xproj
If I understand correctly, the projects you are trying to link are both using project.json, right? This can be done by editing the project.json files. For example, you have "WebApp" and want to reference "ClassLib", edit the project.json file in the "WebApp" project to contain:
{
"dependencies": {
"ClassLib": {
"type": "project"
}
}
}
This part assumes that "ClassLib" is targeting a framework that is compatible with "WebApp", as listed in the "frameworks" section in project.json If your WebApp is targeting .NET Framework 4.6 (net46), then Class Lib should also target net46 or one of the frameworks compatible with "net46", such as "net451" or "netstandard1.3".