You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using ML.Net in Classic Windows Console or WPF App #357
but I would like to also run it within a classic Windows console or WPF app (eg .Net 4.5.2).
Is it possible to do this with the current Nuget?
My problem is that when I try to install the ML.Net Nuget package - the package manager says its installed (see output below). But the ML.Net package never shows up in the references section and I find it, thus, hard to use it in this context.
Is this a current limitation of VS or an issue with the ML.Net nuget package? Is there a workaround solution?
Package Manager output log:
Attempting to gather dependency information for package 'Microsoft.ML.0.2.0' with respect to project 'Classifier', targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 70.64 ms
Attempting to resolve dependencies for package 'Microsoft.ML.0.2.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.ML.0.2.0'
Resolved actions to install package 'Microsoft.ML.0.2.0'
Retrieving package 'Microsoft.ML 0.2.0' from 'nuget.org'.
Adding package 'Microsoft.ML.0.2.0' to folder 'C:\Users\NOP\Desktop\Classifier\packages'
Added package 'Microsoft.ML.0.2.0' to folder 'C:\Users\NOP\Desktop\Classifier\packages'
Added package 'Microsoft.ML.0.2.0' to 'packages.config'
Successfully installed 'Microsoft.ML 0.2.0' to Classifier
Executing nuget actions took 1.05 sec
Time Elapsed: 00:00:01.3016144
========== Finished ==========
From your Package Manager output (thanks for the log - it helps a ton in figuring out what is going wrong), I see you are targeting .NET Framework v4.5.2.
Microsoft.ML targets netstandard2.0. Unfortunately, netstandard2.0 libraries are not compatible with .NET Framework v4.5.2. Instead, please re-target your project to v4.6.1 or higher in order to work with Microsoft.ML.
Maira, @Dirkster99,
Please take a look at PR #248 for a nifty command line tool that allows you to run variety of ML.NET jobs from the classic console.
I am fine with the limitation if its a known limitation I suggest we:
make sure its documented - so far the documentation only stated that ML.Net can be used in a classic .Net application (I think I saw that somewhere).
What I find strange though is that the Package Manager says its installed when the reference is not showing up. It would be great if this problem could be tracked down and be re-solved, such that others do not get the same weird experience, because I would expect a package to be either installed or not, right?
After a little more investigation, I figured out why the package is installing successfully, even when the project is targeting an unsupported framework version. I've created a PR to fix the NuGet package so NuGet will raise an error when installing on unsupported frameworks again.
Thanks for the help in finding and reporting this issue, @Dirkster99.
As far as I can tell, #366 is a different issue. In this case (#357), the scenario should not work. In #366, the scenario should work. The difference is targeting net461 and above should work because we are using netstandard2.0.
Cool - @mairaw Can you make sure the documentation lists the supported versions of the different .Net frameworks including those versions that are supported by netstandard2.0 (.Net 4.6.1)? I think that would be very helpful for everyone wanting to consider this in their own app ...
Activity
danmoseley commentedon Jun 15, 2018
I dot not know why this does not work. @eerhardt do you have ideas of possible causes for this?
eerhardt commentedon Jun 15, 2018
From your Package Manager output (thanks for the log - it helps a ton in figuring out what is going wrong), I see you are targeting .NET Framework v4.5.2.
Microsoft.MLtargetsnetstandard2.0. Unfortunately,netstandard2.0libraries are not compatible with .NET Framework v4.5.2. Instead, please re-target your project to v4.6.1 or higher in order to work withMicrosoft.ML.To read more about
netstandardand its mapping to the .NET Framework, check out https://docs.microsoft.com/en-us/dotnet/standard/net-standard.glebuk commentedon Jun 15, 2018
Maira, @Dirkster99,
Please take a look at PR #248 for a nifty command line tool that allows you to run variety of ML.NET jobs from the classic console.
mairaw commentedon Jun 15, 2018
The original issue is actually from @Dirkster99 not me. I just moved it here. 😄
Dirkster99 commentedon Jun 17, 2018
I am fine with the limitation if its a known limitation I suggest we:
make sure its documented - so far the documentation only stated that ML.Net can be used in a classic .Net application (I think I saw that somewhere).
What I find strange though is that the Package Manager says its installed when the reference is not showing up. It would be great if this problem could be tracked down and be re-solved, such that others do not get the same weird experience, because I would expect a package to be either installed or not, right?
Dirkster99 commentedon Jun 18, 2018
#366 Looks like a duplicate to me - it does not seem like targeting 4.6.1 resolves this either...
Move the NuGet package build files into a TFM specific directory.
eerhardt commentedon Jun 18, 2018
After a little more investigation, I figured out why the package is installing successfully, even when the project is targeting an unsupported framework version. I've created a PR to fix the NuGet package so NuGet will raise an error when installing on unsupported frameworks again.
Thanks for the help in finding and reporting this issue, @Dirkster99.
As far as I can tell, #366 is a different issue. In this case (#357), the scenario should not work. In #366, the scenario should work. The difference is targeting net461 and above should work because we are using netstandard2.0.
Dirkster99 commentedon Jun 18, 2018
Cool - @mairaw Can you make sure the documentation lists the supported versions of the different .Net frameworks including those versions that are supported by netstandard2.0 (.Net 4.6.1)? I think that would be very helpful for everyone wanting to consider this in their own app ...
mairaw commentedon Jun 18, 2018
@JRAlexander can you open an issue in dotnet/docs to add information about which versions are supported by ML.NET? Perhaps this could go to the homepage (https://docs.microsoft.com/en-us/dotnet/machine-learning/)?
For versions supported by a specific .NET Standard version, I'd just link to https://docs.microsoft.com/en-us/dotnet/standard/net-standard for more info.
Move the NuGet package build files into a TFM specific directory. (#370)
JRAlexander commentedon Jun 18, 2018
Yes, I will do that!
Merge master into release/preview branch for v0.3 (#426)
Move the NuGet package build files into a TFM specific directory. (do…