Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .NET 3.5 reference assemblies once they exist in the package #99

Closed
j3parker opened this issue Oct 28, 2019 · 2 comments
Closed

Use .NET 3.5 reference assemblies once they exist in the package #99

j3parker opened this issue Oct 28, 2019 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@j3parker
Copy link
Member

See dotnet/installer#2022

As of #88 we support frameworks like .NET 3.5 when imported from NuGet packages, but we can't compile anything (if you dep on @net packages... which you do by default). Once Microsoft adds .NET 3.5 to their package we should wire it up.

@j3parker j3parker added the enhancement New feature or request label Oct 28, 2019
@j3parker j3parker added this to the v1 milestone Oct 28, 2019
@j3parker
Copy link
Member Author

Well, they've officially said this won't be supported. So I'm going to close this.

@jnm2
Copy link

jnm2 commented Nov 25, 2019

Because net35 is still in support and net40 and net20 are not, and this targeting pack includes net20 and net40 but not net35, and because I'm familiar with the pain of not having the choice to stop supporting net35, I created a community package to go along with these:

https://www.nuget.org/packages/jnm2.ReferenceAssemblies.net35

There doesn't seem to be any technical limitation distinguishing this package from the Microsoft packages, and my integration tests show this working fine:

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

  <PropertyGroup>
    <TargetFrameworks>net35;net40;netstandard2.0;netcoreapp3.0</TargetFrameworks>
  </PropertyGroup>
  
  <ItemGroup>
    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-*" />
    <PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.0-*" />
  </ItemGroup>

</Project>
ClassUsingSystemLinq.cs
using System.Linq;

public class ClassUsingSystemLinq
{
    public ClassUsingSystemLinq()
    {
        Enumerable.Empty<int>();
    }
}

This solves the problem of having to use VSWhere to find MSBuild when compiling for net35 on Windows and the problem of having to use Mono's MSBuild when compiling for net35 on macOS and Linux. dotnet build all the way. Here's to less infrastructure fighting. Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants