2

I have created the two projects with respect to support .NET Standard version 1.2 & 1.4 and refer the project.json as per target version. Then create the NuGet package with nuspec below.

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>package id</id>
<version>15.1120.0.1</version>
<authors></authors>
<owners></owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl> </licenseUrl>
<projectUrl></projectUrl>
<iconUrl> </iconUrl>
<description> </description>
<copyright></copyright>
<tags> </tags>
<dependencies>
  <group targetFramework=".NETStandard1.2">
    <dependency id="Microsoft.NETCore.Portable.Compatibility" 
     version="1.0.1" />
    <dependency id="NETStandard.Library" version="1.6.0" />
  </group>
  <group targetFramework=".NETStandard1.4">
    <dependency id="Microsoft.NETCore.Portable.Compatibility" version="1.0.1" />
    <dependency id="NETStandard.Library" version="1.6.0" />
  </group>
</dependencies>
 </metadata>
 </package>

It creates the package properly. Now I want to refer this package in the .NET core 1.0 version application with .NET framework 4.6.1. As pre-the .NET Standard Support It should refer the .NET Standard 1.4 version. But it refers .NET Standard 1.2 reference. What I was missing in the package creation. Also,can we please let me know whether we can include multiple target in .NET Standard or not?

Parthi
  • 361
  • 6
  • 21
  • You should target the lowest .NET Standard possible. Find the lowest common .NET Standard for your platforms here: https://learn.microsoft.com/en-us/dotnet/standard/net-standard – koelkastfilosoof Jul 06 '17 at 13:24
  • Yes @koelkastfilosoof, .NET Standard 1.4 should refer in the net461 framework. but it refer .NET Standard 1.2 version. – Parthi Jul 06 '17 at 13:30
  • If you have an application that targets .NET Framework 4.6.1 you can perfectly fine include .NET Standard packages up to version 1.4. – koelkastfilosoof Jul 06 '17 at 13:34
  • @Parthi did you create the nuspec yourself or did you just call `dotnet pack` on the project? – Martin Ullrich Jul 06 '17 at 15:17

0 Answers0