Compatibility/ Documentation with ML.NET on MVC5 - asp.net-mvc-5

I've read online and watched some videos concerning ML.NET and the usage of it. All the videos and documentation that I've read online were on ASP.NET Core. I was wondering if it was possible to use the ML.NET on MVC5 (Since that's what we've been taught in class and have to use for our project)
If it is compatible are there any links or suggestions on how to go about it?

ML.NET requires .NET Core in version 2.1 (or newer) or .NET Framework version 4.6.1 (or newer):
First, ensure you have installed .NET Core 2.1 or later. ML.NET also works on the .NET Framework 4.6.1 or later, but 4.7.2 or later is recommended.
Source: GitHub page for ML.NET
As long as your app is running on one of those .NET implementations, you should be good to go. Regardless of the app type (ASP.NET, Winforms, ...).
You can find samples here.

Related

WindowsAzure.Storage SDK missing APIs in .NET Standard

I am converting a .NET Framework 4.7.1 class library to .NET Standard 2.0.
The library consumes a number of Nuget packages, all of which are available for both .NET Framework and .NET Standard and these packages include the WindowsAzure.Storage SDK.
The original .NET Framework class library compiles and runs correctly, but the .NET Standard library fails to compile, due to missing APIs (and some different method signatures) on the WindowsAzure.Storage SDK.
For example, CloudBlockBlob has a DeleteIfExists method in .NET Framework but not in .NET Standard.
The API documentation lists this method (and all the others that are broken in .NET Standard) but doesn't appear to mention any version differences between target frameworks. Did I miss something relevant here?
Is it normal that some .NET Standard Nuget packages have gaps in their APIs?
Is there a solution or a workaround for this (apart from re-writing the code that consumes these APIs)?
Thanks, in advance.
As per Peter Bons mentioned, In the nuget package WindowsAzure.Storage, there are only task based methods, so DeleteIfExistsAsync for .net core / .net standard.
Please use the new nuget package for azure storage. For blob storage, you can install Microsoft.Azure.Storage.Blob, version 9.4.0 or above, which does support sync / async methods.
The change log is here:
And here is a simple test with .net standard project with Microsoft.Azure.Storage.Blob, version 9.4.0 or above installed. Both sync / async methods are there.

MSMQ support for .net core

It looks like there are no libraries provided in .net standard / .net core to support MSMQ.
In that case, how can we use MSMQ while working with asp.net core 2.0 and above web application?
I recently noticed this NUGET package: Experimental.System.Messaging
I've not yet tried it but it seems like it might be helpful for what you need.

Target .NET Core 2.0 with Azure Functions in Visual Studio 2017

Since Microsoft has released .NET Core 2.0 for Azure Functions a few days ago, I'm trying to understand how to create a new Functions project in VS2017 targeting .NET Core.
I've tried many configurations and still ended up with .NET 4.7.
Did anyone manage to create a new Function targeting .NET Core?
Thanks.
This is supported with the 1.0.5 release of the Microsoft.NET.Sdk.Functions package.
In your Azure Functions Project, do the following:
Update the Microsoft.NET.Sdk.Functions package version to 1.0.5
Right click on your project, click the Edit <projectname>.csproj option and modify the TargetFramework element value to netstandard2.0
This will should generate .NET Standard 2.0 assemblies with all the artifacts created by the Azure Functions tooling.
As of today I have been able to target .Net Standard 2.0 in a "reasonably" intuitive way and without editing any .csproj files.
You need a reasonably recent version of Visual Studio. I'm using Visual Studio Professional 15.5.3 (although I would guess that community would work).
You need to have the Azure development workload installed. This will install an extension called Azure Functions and Web Jobs Tools.
So far so plain vanilla. There were 2 additional bits that were to me not at all intuitive but ended up being very easy to do - easy when you know how!
You need to make sure that the Azure Functions and Web Jobs Tool is 15.0.31114.0 or greater - that's when they added .net core 2.0 support (see https://github.com/Azure/Azure-Functions/blob/master/VS-AzureTools-ReleaseNotes.md). You can update this using Tools/Extensions and Updates, or see https://marketplace.visualstudio.com/items?itemName=VisualStudioWebandAzureTools.AzureFunctionsandWebJobsTools
Even when you've done that, Visual Studio is a tiny bit weird about letting you create Azure Functions that target .net 2.0. When you go File/New Project, nothing has changed in the list of available project types, and if you select Azure Functions, the list of Frameworks just shows .NET Framework *, no .NET Standard, no .NET Core.
But if at this point you persevere and select Azure Functions, you then get a new dialog I hadn't seen before, which allows you to select Azure Functions v2 Preview (.NET Core).
Now, when I then look at the project properties, it turns out it is targeting .NET Standard 2.0, which in turn seems to contain Microsfot.NETCore.Platforms (1.1.0). So is this .net core 2.0 or not? Not quite sure but its' good enough for my purposes so now going to tuck into some coding.
Cheers!
For now, it's a manual process. You need to create .NET Standard 2.0 library, add function.json manually and run it with core tools.
the package Microsoft.NET.Sdk.Functions does not yet support .NET Standard 2.0 class libraries. This is the package that identifies a project as Functions project to Visual Studio and generates function.json from attributes during build.
You can still author C# class libraries that target .NET Standard 2.0, but you must use a manually-authored function.json. The templates for C# class libraries aren’t yet available in the Core Tools, but you can get a sample from GitHub.
from Develop Azure Functions on any platform
Update: 1.0.5 version of SDK should now support it, as mentioned by Fabio.

Is there any advantage to a .NET Core library over .NET Standard library?

I'm porting my applications from VS2015 to VS2017 and trying to figure out the right migration path. I'm also moving my web services to .NET Core to take advantage of deploying to Linux or Windows servers. I see that I have the option of creating base libraries in .NET Standard or .NET Core. Is there any advantage to a .NET Core library or should I create the base libraries in .NET Standard by default?
Practically speaking, .NET Standard 2.0 is the intersection of .NET Framework 4.6.2(-ish) and .NET Core 2.0.
If you build a library targeting .NET Standard 2.0 then your library can be consumed by .NET Framework libraries and applications, as well as .NET Core libraries and applications. That's the advantage of Standard.
But there are several types/members that have been added to .NET Core which aren't part of .NET Standard. If you want to use something like the new CertificateRequest class you'd need to explicitly target .NET Core.
.NET Core allows new things to get to users faster than .NET Framework does, so the general tradeoff will always be ".NET Standard => more places; .NET Core => newer things".
.Net Standard is just package with interfaces with can be used to provide compatibility across .Net Framework, .Net Core and others
I wouldn't choose a .NET Core library. The differences are in the referenced libraries:
the .NET Standard library references the netstandardX.X NuGet meta-package
the .NET Core library references the netcoreappX.X NuGet meta-package
The netcoreapp package also includes some .NET Standard packages, but also a bunch of .NET Core App specific packages (including libuv. Don't know why a library needs libuv.)
So the .NET Standard library is for cross platform and the .NET Core library just for .NET Core

Can ServiceStack run on .net core on Linux?

The documentation about Linux hosting only mentions mono. Can the new .net core and asp.net core (DNX) also be used?
ServiceStack now supports running on .NET Core from October 20, 2016 v4.5.2 Release.
Nearly all of ServiceStack’s features are now available across 21 of our most popular NuGet packages, inc. OrmLite support for SQL Server, PostgreSQL and Sqlite. We’ve been able to achieve excellent integration and code-reuse where your ServiceStack AppHost can be registered as a .NET Core module and most of your Service Implementation using ServiceStack libraries remains unchanged.
We’ve ported a number of existing Live Demos to .NET Core providing example projects so you can easily compare .NET 4.5 ServiceStack code-bases with what it looks like in .NET Core at:
https://github.com/NetCoreApps/LiveDemos
All .NET Core Live Demos are running on Linux / Docker using AWS ECS Container Service.
We’re maintaining .NET Core packages isolated from the Main NuGet packages separated with a .Core suffix until we’re satisfied .NET Core has been battle-tested in the wild which will enable us to make frequent releases outside of the main .NET 4.5 release cycle.
Please see the full v4.5.2 Release Notes for details on running ServiceStack on .NET Core, its integration story and the different conventions in .NET Core.

Resources