Visual Studio 2017, .NET Standard and Xamarin

Visual Studio 2017 will change the way we work with .NET Standard. If you have .NET Standard projects now, you will have seen the project.json file. Project.json is now dead and buried, and everything has moved back into the csproj file. This also means no more .xproj file.

Upgrading from Visual Studio 2015

If you are coming from Visual Studio 2015, first I will go through a few quick upgrade scenario’s.

XProj Conversion

If you have any .xproj files, then you will be asked to automatically convert them to csproj, when you load the project in Visual Studio 2017. XProj file extensions are no longer relevant in Visual Studio 2017, they are an obsolete format.


This will remove the project.json file and put all that information into your csproj.

Portable Conversion

If you have a portable library targeting .NET Standard that has a project.json file, it will not be converted, since its already a csproj. It will continue to function the same as before. If you want to upgrade to the new .NET Standard library format, you will have to do this manually, by either modifying the csproj file, or the easy way of, creating a new .NET Standard Library and copying across your files. I will now go through how to setup a new .NET Standard Library.

.NET Standard Library

First, I will assume you installed the .NET Core tools when installing Visual Studio 2017. If not, modify your install and install the following.


When you go to create a .NET Standard Library, take note of which one you should actually create. You want to create a .NET Standard Library, not a .NET Core Library.


You will notice there is no project.json. Only your code and Dependencies.


If you right click and go into Properties, you will see the Target Framework is set to .NETStandard x.x.


Referencing Non .NET Standard Libraries

Since Xamarin Forms isn’t a .NET Standard Library, with project.json we had to use an imports line. Otherwise, as with the new .NET Standard Libraries, it will be unable to install a package that isn’t .NET Standard.

There is currently a bug with Xamarin Forms and .NET Standard Class Libraries. Bug 53060 – Fail to compile .NET Standard Class Library in VS2017

This is the old project.json file.

"frameworks": {
    "netstandard1.3": {
        "imports": "portable-net45+win8+wpa81"

With Visual Studio 2017, we can Edit our csproj, without unloading it. Right click and press Edit <yourprojectname>.csproj.


When editing the csproj, you will see text similar to below.

<Project Sdk="Microsoft.NET.Sdk">

Now, to add the imports section to the csproj, we need to add in this line.


Separate any other frameworks you want to support with the semi-colon( ; ) on the same line.

Xamarin Projects

Nothing changes with platform specific Xamarin Projects. You no longer need the project.json file and can use the previous methods for managing nuget packages. You can reference a .NET Standard library from any Xamarin.Android, Xamarin.iOS and UWP project, as you did previously.

Microsoft MVP | Xamarin MVP | Xamarin Certified Developer |
Exrin MVVM Framework | Xamarin Forms Developer | Melbourne, Australia

Related Posts


  1. Gerhard Faber

    Hello Adam,
    I want to use a net standard library from an existing PCL and I get
    “C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.Common.targets(73,5): error : Für das Projekt “***.csproj” ist kein mit “.NETPortable,Version=v4.5,Profile=Profile259″ kompatibles Framework vorhanden.

    Is this error related to the bug you’ve listed. too?

  2. Brian Limkemann

    Adam, do you have XAML Intellisense in your .NET standard shared libraries? In a normal PCL I do have it but in a NETStandard shared library I have no XAML Intellisense at all. Here are my targets and fallbacks:


    1. Jan Göltenboth

      The same here…After converting all PCL libs into NETStandard the Intellisense stopped working in all xaml files. For some reason it works when applying the same steps in a newly created xamarin template. In NETStandard it does not add the “DependentUpon” attribute to combine xaml and related .cs files and the generator-attribute is now set to “MSBuild:UpdateDesignTimeXaml” by default.

  3. Dirk

    Hello Adam,

    i have a forms project with project.json files like in your previous posts. After installing VS2017 i tried using dotnet migrate to migrate to the new csproj files. This worked well for the pcl and i can compile that.

    But i have a problem with the droid project (haven’t tried the ios project yet). When i try to compile that, i get this error message:

    “Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework=’monoandroid71′. They must be specified explicitly.”

    The new csproj looks like this:


    I don’t know how to correct this error.

    I hope you can help me with his.


    1. Adam Pedley

      With Android projects, I just leave them as the default csproj that happens when you create a new Xamarin.Android proj. I can still reference .NET Standard libraries from them. I actually don’t know how android csproj’s are meant to work if transferred to the new system.

      But if you want to continue with trying to get this working, these errors are shown when it can’t figure out the TFM, hence you need to define it manually. e.g.

      <PropertyGroup Condition=”‘$(TargetFramework)’ == ‘portable-net40+sl5+win8+wpa81+wp8′”>

      I don’t know what that would need to be for Android though.

Leave A Comment?