Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# .NET Framework Console application template missing

I'm having trouble creating F# Console App using .Net Framework (not .Net Core). When I open:

Visual Studio 2017 -> New project -> Visual F# -> .Net Standard

the only template visible is Class Library.

Using Visual Studio Installer I added following packages:

  • F# Language Support (I know this is a dependency for .Net Core, but it still might be important)
  • F# Desktop Language Support (the installer said it has only 147KB size, is that okay?)

However, this didn't change anything - still there is no template for Console Application. I have also tried to see if target version of .NET Framework changes anything, but it doesn't - am I missing anything else?

Note: I can't use the .Net Core version, even though I would like to, because the use of the framework I'm going to use only supports .Net Standard framework - it requires System.Windows.Forms.

like image 719
Asunez Avatar asked Jan 26 '18 09:01

Asunez


2 Answers

Apparently I'm blind. However, to my excuse, I need to clarify:


To create a Console App using .Net Framework (not Core) I needed to click on:

Visual Studio 2017 -> New project -> Visual F# (the template is here)

and not:

Visual Studio 2017 -> New project -> Visual F# -> .Net Standard (the template is one step up in hierarchy)


Explanation:

As stated by @PanagiotisKanavos in comments:

.NET Standard is only used for portable libraries.

So it's not even supposed to be there at all.


NOTE:
F# Desktop Language Support is a required package containing the templates for F# Console App (and other non-core templates).

If you do not have this installed, you will not see the template no matter where you click. You can install it using Visual Studio Installer through Individual Components tab.

like image 65
Asunez Avatar answered Oct 31 '22 13:10

Asunez


This is not an answer but a work around.

You can create 2 projects. F# library and a C# console application. Reference the F# project to your C# console application. From there you can call your F# methods from inside of your console app.

like image 1
mark vanzuela Avatar answered Oct 31 '22 12:10

mark vanzuela