Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use a different .net language (F#) for asp.net vnext

Tags:

asp.net-core

I'm interested how I can use a different .NET language (F# for instance) and still target asp.net vNext. One way I can think of is making a F# NuGet package and reference it but this still does not allow you to use F# or any other .net language for all the implementation (I'm not talking about the razor pages here).

I mean it seems that when you do a k run it simply compiles all the *.cs files using Roslyn and call it a day. No way to change anything or at least I could not find a way.

This means the only other option to target asp.net vnext completely from another .net language (not Roslyn supported meaning not C# or vb.net) is to somehow compile an assembly referencing the asp.net vnext assemblies and run it in IIS? Thus bypassing the k run or the k web defined in project.json?

like image 834
HariSeldon Avatar asked Jul 02 '14 07:07

HariSeldon


People also ask

How does .NET support different languages?

The main reason for . NET to be multilingual is that you can compile your code from IL and this compiled code will be interoperable with the code that has been compiled to IL from another language. It simply means that you can create pages in different languages (like C#, VB .

What languages can .NET use?

NET (pronounced dot net) is a framework that provides a programming guidelines that can be used to develop a wide range of applications–––from web to mobile to Windows-based applications. The . NET framework can work with several programming languages such as C#, VB.NET, C++ and F#.

Does .NET support multiple languages?

NET framework is a Top-Level Domain (TLD) which was initially developed for networking technology, but now supports multiple programming languages such as Visual Basic, C#, and J# at an intermediate level by interoperating with them.

What is .NET F#?

F# is part of the . NET developer platform. Use your skills, code, and favorite libraries to build all types of apps.


1 Answers

After playing more with the samples and making some tests in iisexpress I can confirm that you can use F# and run an F# based asp.net vnext web app.

I used a simple sample that was just responding from the Startup class in configure with a string. I compiled it and referenced the Microsoft.AspNet.Http assembly from the user kre packages folder. I used AspNet.Loader.dll from the Helios in bin folder and also copied there the f# assembly and it all works well under iisexpress.

like image 137
HariSeldon Avatar answered Sep 23 '22 19:09

HariSeldon