question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET Framework targeting pack NuGet packages are missing net35 target framework

See original GitHub issue

net35 is a legit target framework for .NET projects, but projects that target that framework can’t build off Windows even when referencing the Microsoft.NETFramework.ReferenceAssemblies package.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

17reactions
jnm2commented, Dec 5, 2019

Because net35 is still in support and net40 and net20 are not, and the Microsoft.NETFramework 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!

3reactions
jnm2commented, Dec 5, 2019

ℹ 1.0.0 of https://www.nuget.org/packages/jnm2.ReferenceAssemblies.net35 is up, mirroring the changes made in Microsoft.NETFramework.ReferenceAssemblies 1.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Target frameworks in SDK-style projects - .NET
For package-based target frameworks (for example, .NET 5+, .NET Core, and .NET Standard), the APIs are defined by the NuGet packages ...
Read more >
Unable to build a multi-targeting .NET library for net20 and ...
TargetFramework ) (in my case Microsoft.NETFramework.ReferenceAssemblies.net35 ) package, which it seems to be doing when you look at the ...
Read more >
NuGet — Targeting both .NET Standard and the .NET ...
Using a .NET Framework NuGet package with a .NET Core application. For this example I created a new .NET Core console application in...
Read more >
If I want to create a NuGet package, should I write it in .NET ...
NET Framework. If you need to target a specific runtime, you should target .NET Core and not .NET Framework. All of .NET will...
Read more >
Building a project that target .NET Framework 4.5 in Visual ...
Just download the package from NuGet, open it as a zip, and copy the files from build\.NETFramework\v4.5\ . And that's it! Visual Studio...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found