fsprojects/fsharp-dnx-templates

Name: fsharp-dnx-templates

Owner: F# Community Project Incubation Space

Description: Visual Studio templates for creating DNX projects with F#.

Created: 2015-10-16 15:15:21.0

Updated: 2016-06-29 16:51:08.0

Pushed: 2016-04-05 09:15:53.0

Homepage: null

Size: 32

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

fsharp-dnx-templates

Visual Studio templates for creating DNX projects with F#.

Getting started

Right now we have the following templates:

The installation approach is identical for each template.

To get Visual Studio to register the templates, you can run devenv.exe /installvstemplates. (devenv.exe is in the ..\Microsoft Visual Studio 14.0\Common7\IDE\ folder.)

FAQ
Where can I find the FSharp.Dnx dependency?

The FSharp.Dnx dependency can be found in the fsprojects NuGet feed: https://www.myget.org/F/fsprojects/api/v3/index.json You can include it in your NuGet.Config file:

l version="1.0" encoding="utf-8"?>
figuration>
ackageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="fsprojects" value="https://www.myget.org/F/fsprojects/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
packageSources>
nfiguration>

If you don't have a NuGet.config file, create it yourself in the solution root. You can then add it to Visual Studio by right-clicking the solution node in the Solution Explorer and adding an existing item.

Why does an EmptyWeb application return 500 Internal Server Error when running it? I haven't changed a thing!

Because you need a newer version of Microsoft.AspNet.IISPlatformHandler which you can get by adding the ASP.NET “dev” build NuGet feed to your NuGet.Config.

Why is the Program type a class with a Main method and not a simple F# function like the standard F# Console Application template?

When DNX loads, it looks for a class called Program with a method called Main. You can do

space ConsoleApplication1

 Program () =
member x.Main (argv: string array) =
    printfn "%A" argv
    0

but you can also do

le MyModule

 Program () =
member x.Main (argv: string array) =
    printfn "%A" argv
    0

or

le Program

Main (argv: string array) =
printfn "%A" argv
0

If you choose to use a Program class, you can do dependency injection, e.g. inject an IApplicationEnvironment.

Maintainer(s)

The default maintainer account for projects under “fsprojects” is @fsprojectsgit - F# Community Project Incubation Space (repo management)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.