For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • Overview
    • Introduction
    • How it works
    • Quickstart
    • Customer showcase
  • Working with SDKs
    • Project structure
    • Adding custom code
    • Migrating to Replay
    • Capabilities
  • Generators
      • Generating an SDK
      • Publishing to NuGet
      • Configuration
      • Adding custom code
      • Version compatibility
      • Changelog
      • Customer showcase
  • Reference
    • generators.yml
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
On this page
  • Supported frameworks
  • Using SDKs with Unity
  • Project configuration examples
  • Troubleshooting
Generators.NET

.NET compatibility

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Adding custom code

Next

Changelog

Fern-generated .NET SDKs support modern .NET versions, .NET Framework versions, and Unity.

Because these SDKs are built with modern C# features, you’ll need the following even when targeting older .NET Framework targets:

  • A modern compiler (Visual Studio 2022 or .NET SDK)
  • The appropriate .NET Framework Developer Pack or reference assemblies

Supported frameworks

Fern .NET SDKs support all officially supported .NET versions, except for net35.

FrameworkTarget Framework Moniker (TFM)
.NET 9net9.0
.NET 8net8.0
.NET Framework 4.8.1net481
.NET Framework 4.8net48
.NET Framework 4.7.2net472
.NET Framework 4.7.1net471
.NET Framework 4.7net47
.NET Framework 4.6.2net462

The C# language version is determined by your compiler, while the target framework determines which runtime and base class library APIs are available. Fern SDKs use modern C# features but compile to older framework versions.

IDE compatibility

All major IDEs support Fern-generated SDKs when targeting net462, net472, and net48 versions:

  • Visual Studio 2022 (recommended) - Works out of the box. Set <LangVersion> in your project and install the appropriate developer pack.
  • Visual Studio 2019 - Supports C# 9 natively. For newer C# versions, add the Microsoft.Net.Compilers.Toolset package.
  • Rider - Uses Roslyn. Set <LangVersion> and ensure reference assemblies are available.
  • VS Code - Works via OmniSharp and .NET SDK builds.
  • Unity - Uses Unity’s own C# compiler. See Using SDKs with Unity.

You can “bring your own compiler” with the Microsoft.Net.Compilers.Toolset package on any environment.

Compiler compatibility

Use the Roslyn compiler (csc) that comes with Visual Studio 2022+ or the .NET SDK. Set your C# version via <LangVersion> to latest, preview, or a specific version (minimum 9).

Fern’s .NET SDK doesn’t support the legacy Mono compiler (mcs, gmcs) or the pre-Roslyn csc.exe compiler. Use Roslyn even when building on Mono.

Building on Mono

Use the .NET SDK (dotnet) with the Microsoft.NETFramework.ReferenceAssemblies package to supply net48 references on non-Windows. Use Roslyn via dotnet build or Mono’s MSBuild.

macOS/Linux
$dotnet build -c Release
Developer packs
  • .NET Framework 4.6.2 Developer Pack
  • .NET Framework 4.7.2 Developer Pack
  • .NET Framework 4.8 Developer Pack

Using SDKs with Unity

Unity controls its own C# compiler and .NET profile, which affects how you use Fern’s .NET SDK.

C# language version

Unity compiles projects using Roslyn, typically supporting C# 9 (varies by Unity version). You can’t force Unity to use a newer C# compiler by changing your package because Unity controls the compiler inside the Editor.

API compatibility level

Configure this in Unity: Edit → Project Settings → Player → Other Settings → Api Compatibility Level

  • .NET Standard 2.1 (recommended for cross-platform plugins)
  • .NET Framework 4.x (Unity’s “4.x equivalent” profile)
Required assemblies

Unity doesn’t support NuGet packages, so you must manually download and add these assemblies to your Unity project:

AssemblyNuGet Package
Microsoft.Bcl.AsyncInterfaces10.0.0-preview.6.25358.103
OneOf3.0.271
OneOf.Extended3.0.271
System.Buffers4.6.1
System.IO.Pipelines10.0.0-preview.6.25358.103
System.Memory4.6.3
System.Runtime.CompilerServices.Unsafe6.1.2
System.Text.Encodings.Web10.0.0-preview.6.25358.103
System.Text.Json10.0.0-preview.6.25358.103
System.Threading.Tasks.Extensions4.6.3
portable.system.datetimeonly9.0.0

Project configuration examples

Use SDK-style projects where possible, as they provide modern compilers and simpler multi-targeting. If you have a classic project format, consider converting to SDK-style. The legacy projects section covers legacy setups that can’t be converted.

Building on macOS/Linux

When building for net48 on macOS/Linux, you won’t have the Windows targeting packs. Add the reference assemblies package:

YourProject.csproj
1<ItemGroup>
2 <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
3</ItemGroup>

This provides the net48 reference assemblies so Roslyn can compile for net48 on any platform. You’ll still need Mono or Wine to execute the result.

SDK-style projects (recommended)

Targeting net48 with modern C#

1

Configure your project

Prerequisite (Windows)

Install the .NET Framework 4.8 Developer Pack so the net48 reference assemblies are available to the compiler.

YourProject.csproj
1<Project Sdk="Microsoft.NET.Sdk">
2 <PropertyGroup>
3 <!-- Target .NET Framework 4.8 -->
4 <TargetFramework>net48</TargetFramework>
5
6 <!-- Use a modern C# version -->
7 <LangVersion>latest</LangVersion>
8
9 <!-- Optional, but recommended for better warnings -->
10 <Nullable>enable</Nullable>
11 </PropertyGroup>
12</Project>
2

Build your project

$dotnet build -c Release
3

Multi-target (optional)

To support multiple frameworks, use <TargetFrameworks>:

YourProject.csproj
1<TargetFrameworks>net48;net8.0</TargetFrameworks>
Legacy projects

For older MSBuild/Visual Studio versions, Visual Studio 2019, or legacy packages.config setups, add a modern Roslyn toolset and target the old framework.

1

Install target packs

Install the appropriate .NET Framework Developer Pack so Visual Studio can find the reference assemblies.

2

Set language version

YourProject.csproj
1<PropertyGroup>
2<!-- Unlock modern C# -->
3<LangVersion>latest</LangVersion>
4</PropertyGroup>

Or use a specific version: 9, 10, 11, 12, or preview.

3

Add modern compiler

YourProject.csproj
1 <ItemGroup>
2 <PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="x.y.z">
3 <!-- Keep it private: -->
4 <PrivateAssets>all</PrivateAssets>
5 </PackageReference>
6 </ItemGroup>

This ensures your build uses a modern csc.exe even if your IDE/MSBuild is older.

Troubleshooting

Type or namespace IsExternalInit not found

Add a small shim in your project or reference a helper package.

Reference assemblies for .NETFramework,Version=v4.8 were not found
  • Windows: install the .NET Framework 4.8 Developer Pack.
  • Cross-platform/CI: add Microsoft.NETFramework.ReferenceAssemblies to the project (as PrivateAssets=all).
VS 2019 can't parse newer syntax

Add Microsoft.Net.Compilers.Toolset to the project, or move to VS 2022+.

CS0619: Constructors of types with required members are not supported

This error occurs when using the required keyword with older Visual Studio versions. Follow the instructions at Legacy projects to add a modern compiler.

Some versions of Visual Studio may show this error in the IDE but compile the project successfully when using the package-provided compiler.