Others

How to Create an F# .NET Framework Class Library in Visual Studio 2022

Steven ParkerSteven Parker Oct 26, 2026 868 views

Question details

The user needs to create an F# class library targeting the .NET Framework in Visual Studio 2022 but is unable to locate the specific project template.

How to Create an F# .NET Framework Class Library in Visual Studio 2022
Product
Visual Studio 2022
Device & OS
not provided
Scenario
Setting up an F# class library project for legacy .NET Framework integrations, such as Excel-DNA add-ins.
Observed behavior
Visual Studio 2022 only offers templates for .NET and .NET Standard Class Libraries for F#, lacking a direct .NET Framework project template.
Before you start

Ensure you have installed the '.NET desktop development' workload and the F# language components through the Visual Studio 2022 Installer.

Solution 1Recommended

Create a Standard Library and Retarget to .NET Framework

Since Visual Studio 2022 omits the dedicated F# .NET Framework template, you can create a standard .NET class library and manually change its target framework in the project file.

Microsoft has shifted focus toward modern .NET and .NET Standard, meaning legacy .NET Framework templates for F# are hidden or removed. Manually retargeting the project file is the most reliable workaround.

1
Create a new project

Open Visual Studio 2022 and click on 'Create a new project' on the start window.

2
Select F# Class Library template

Search for 'class library' in the search bar, filter the language dropdown to 'F#', and select the standard 'Class Library' template.

3
Configure the project

Name your project and solution, select the default framework provided, and click 'Create'.

4
Edit the project file

In Solution Explorer, double-click the F# project file (.fsproj) to open it in the XML editor.

5
Change the Target Framework

Locate the <TargetFramework> tag and change its value to your required .NET Framework version (for example, <TargetFramework>net48</TargetFramework>). Save the file and rebuild the solution.

Create a Standard Library and Retarget to .NET Framework
Excel-DNA Compatibility: If you are building an Excel add-in using Excel-DNA, verify that your target framework matches the requirements of the Excel-DNA NuGet package versions you intend to install.
Free Microsoft Office alternative

Develop and Test Spreadsheets with WPS Office

If you are developing spreadsheet integrations, macros, or add-ins and looking for a lightweight, highly compatible alternative to Microsoft Office, WPS Office is an excellent choice. It offers deep compatibility with standard Office formats, a familiar user interface, and seamless migration for both developers and standard users.

Fully compatible with Microsoft Excel (.xlsx, .xls, .csv) formats for seamless add-in and macro testing.Free, lightweight, and runs smoothly on older hardware without consuming massive system resources.Familiar ribbon interface ensures a zero-learning curve for straightforward transitions.
microsoft office alternative - wps office

Frequently Asked Questions

Why is the F# .NET Framework Class Library template missing in Visual Studio 2022?

Microsoft has streamlined project templates in Visual Studio 2022 to prioritize modern cross-platform .NET (formerly .NET Core) and .NET Standard. Legacy .NET Framework templates for F# are not included by default to encourage modern development standards.

Can I use .NET Standard for an Excel-DNA add-in?

Yes, modern versions of Excel-DNA support .NET Standard and newer .NET versions. Depending on your target deployment environments, a .NET Standard class library might actually be preferable.

How do I ensure F# is available in the Visual Studio project language list?

Open the Visual Studio Installer, click 'Modify' on your Visual Studio 2022 installation, and verify that the 'F# desktop language support' component is checked under the '.NET desktop development' workload.