0
votes

I'm getting this error when migrating a .NET core lib (DNXCore50) from VS 2015 to VS 2017.

The reference assemblies for framework "DNXCore,Version=v5.0" were not found.

My project file currently looks like this: (after the VS 2017 migration wizard migrated my "project.json" to a .csproj file)

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

  <PropertyGroup>
    <Description>An FTP and FTPS library for .NET, optimized for speed. Provides extensive FTP commands, file uploads/downloads, SSL/TLS connections and FTP proxies.</Description>
    <VersionPrefix>16.3.0</VersionPrefix>
    <Authors>J.P. Trosclair;Harsh Gupta</Authors>
    <TargetFrameworks>netstandard1.6;dnxcore50</TargetFrameworks>
    <DefineConstants>$(DefineConstants);CORE</DefineConstants>
    <RootNamespace>FluentFTP</RootNamespace>
    <AssemblyName>FluentFTP</AssemblyName>
    <OutputType>Library</OutputType>
    <PackageId>FluentFTP</PackageId>
    <NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
    <TargetFrameworkIdentifier>DNXCore</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
    <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
    <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
    <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
    <GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="System.IO" Version="4.3.0.0" />
    <PackageReference Include="System.Net.NameResolution" Version="4.3.0.0" />
    <PackageReference Include="System.Net.Sockets" Version="4.3.0.0" />
    <PackageReference Include="System.Net.Security" Version="4.3.0.0" />
  </ItemGroup>

</Project>

I'm getting the above mentioned error when I compile. Things I've tried:

  • Using .NETPortable v5.0 instead. Too many missing classes here.
  • Using .NETCoreApp v1.0 instead. Every class is missing. Did I use a wrong version?
  • Using DNXCore. No missing classes. Just one error from VS.

What should I use instead of DNXCore 5.0? I need the latest APIs like TlsStream and Uri, stuff not present Or is there a way to force the compiler to compile? Please note this was a working library when I used VS 2015 to compile. Now that I've switched to VS 2017 I cannot compile my project anymore! in either .NET Core or .NET Portable.

2
Usually a socket related library should only require 1.3. I am not sure why for yours 1.6 is required.Lex Li

2 Answers

1
votes

dnxcore50 is no longer used as a TargetFramework. You can see the 1.1.0 documentation for netstandard that lists it as a deprecated moniker.

For the latest .NET Standard documentation, see the .NET Standard FAQ.

You can just completely drop the 2nd TFM all together. netstandard1.6 will work on .NET Core just fine.

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

  <PropertyGroup>
    <Description>An FTP and FTPS library for .NET, optimized for speed. Provides extensive FTP commands, file uploads/downloads, SSL/TLS connections and FTP proxies.</Description>
    <VersionPrefix>16.3.0</VersionPrefix>
    <Authors>J.P. Trosclair;Harsh Gupta</Authors>
    <TargetFramework>netstandard1.6</TargetFramework>
    <DefineConstants>$(DefineConstants);CORE</DefineConstants>
    <RootNamespace>FluentFTP</RootNamespace>
    <AssemblyName>FluentFTP</AssemblyName>
    <OutputType>Library</OutputType>
    <PackageId>FluentFTP</PackageId>
    <NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
    <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
    <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
    <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
    <GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="System.IO" Version="4.3.0.0" />
    <PackageReference Include="System.Net.NameResolution" Version="4.3.0.0" />
    <PackageReference Include="System.Net.Sockets" Version="4.3.0.0" />
    <PackageReference Include="System.Net.Security" Version="4.3.0.0" />
  </ItemGroup>

</Project>

I also removed setting the TargetFrameworkIdentifier and TargetFrameworkVersion since those properties are inferred from TargetFramework.

0
votes

Well, that's surprising!

My lib successfully compiled with .NETStandard v1.6!

Including my XML here in case anyone else has this issue:

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

  <PropertyGroup>
    <Description>An FTP and FTPS library for .NET, optimized for speed. Provides extensive FTP commands, file uploads/downloads, SSL/TLS connections and FTP proxies.</Description>
    <VersionPrefix>16.3.0</VersionPrefix>
    <Authors>J.P. Trosclair;Harsh Gupta</Authors>
    <TargetFrameworks>netstandard1.6;dnxcore50</TargetFrameworks>
    <DefineConstants>$(DefineConstants);CORE</DefineConstants>
    <RootNamespace>FluentFTP</RootNamespace>
    <AssemblyName>FluentFTP</AssemblyName>
    <OutputType>Library</OutputType>
    <PackageId>FluentFTP</PackageId>
    <NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
    <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v1.6</TargetFrameworkVersion>
    <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
    <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
    <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
    <GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="System.IO" Version="4.3.0.0" />
    <PackageReference Include="System.Net.NameResolution" Version="4.3.0.0" />
    <PackageReference Include="System.Net.Sockets" Version="4.3.0.0" />
    <PackageReference Include="System.Net.Security" Version="4.3.0.0" />
  </ItemGroup>

</Project>