How to Create an F# .NET Framework Class Library in Visual Studio 2022
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.

- 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.
Ensure you have installed the '.NET desktop development' workload and the F# language components through the Visual Studio 2022 Installer.
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.
Open Visual Studio 2022 and click on 'Create a new project' on the start window.
Search for 'class library' in the search bar, filter the language dropdown to 'F#', and select the standard 'Class Library' template.
Name your project and solution, select the default framework provided, and click 'Create'.
In Solution Explorer, double-click the F# project file (.fsproj) to open it in the XML editor.
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.

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.

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.




