Skip to content

.NET Framework 4.6.1 - ML.NET package does't show up in references, thus can't use its assembly references.  #366

Closed

Description

@SharPiy

System information

  • Windows 7/ 64 bit OS
  • .NET Framework 4.6.1

Issue

  • I created a console App to use Microsoft.ML. I tried to install ML.NET package - the package manager successfully installed it but it never shows up in references.
  • I am not able to use ML.NET libraries, as even after successfully installing it the using statements gives me red lines to show missing assembly reference error.
    capture
    image
    image

Activity

  1. jwood803 commented on Jun 18, 2018

    @jwood803
    Contributor

    This may be similar to #357?

  2. eerhardt commented on Jun 18, 2018

    @eerhardt
    Member

    What version of Visual Studio are you using? Can you paste the information from the Help -> About dialog using the Copy Info button on the right?

  3. SharPiy commented on Jun 18, 2018

    @SharPiy
    Author

    Microsoft Visual Studio Professional 2015
    Version 14.0.25431.01 Update 3
    Microsoft .NET Framework
    Version 4.7.02558

    Installed Version: Professional

    Visual C# 2015 00322-40000-00000-AA122
    Microsoft Visual C# 2015

  4. eerhardt commented on Jun 18, 2018

    @eerhardt
    Member

    Since you are using VS 2015, and Microsoft.ML is a netstandard2.0 package, you need to be sure to install:

    1. The latest NuGet VSIX for VS 2015 (v3.6.0 as of this writing) from https://www.nuget.org/downloads
    2. The .NET Standard Build Support extension from https://aka.ms/netstandard-build-support-netfx

    Does that help resolve the problem?

  5. SharPiy commented on Jun 18, 2018

    @SharPiy
    Author

    Does updating VS to 2017 would fix this?

  6. eerhardt commented on Jun 18, 2018

    @eerhardt
    Member

    Yes, it works with the VS 2017 out of the box.

    But you can use VS 2015 with the above 2 extensions installed (they shouldn't take more than 5-10 minutes to install - they are pretty small).

  7. SharPiy commented on Jun 18, 2018

    @SharPiy
    Author

    I installed(both links) as suggested. I can now see packages in References but still cant use it in code. Also, System.ValueTuple shows exclamation mark weirdly.
    image
    image

  8. eerhardt commented on Jun 18, 2018

    @eerhardt
    Member

    Did you re-install the package after you installed the extensions?

  9. SharPiy commented on Jun 18, 2018

    @SharPiy
    Author

    Yes. I did.

  10. eerhardt commented on Jun 19, 2018

    @eerhardt
    Member

    Hmm, I'm not quite sure what is happening. Can you zip up your project (without the bin and obj folders) and attach it to this issue?

  11. SharPiy commented on Jun 19, 2018

    @SharPiy
    Author

    MachineLearningProj.zip

    Please find attached

  12. eerhardt commented on Jul 6, 2018

    @eerhardt
    Member

    My apologies, @SharPiy, I had been busy doing other things and finally got back to looking into this.

    Can you try manually editing the .csproj and add the line <ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades> in the first <PropertyGroup>? I was forced to do this in order to workaround dotnet/sdk#1539.

    Also, can you trying building the project, and listing any errors that occur? That may also give some idea as to what is going wrong.

  13. carldupreez111 commented on Aug 13, 2018

    @carldupreez111

    Hi.

    I have the same or similar issue and I am using ML.NET 0.4.0. I'll explain what is happening in full below.

    I am trying to do the tutorial on the following page - https://www.microsoft.com/net/learn/machine-learning-and-ai/get-started-with-ml-dotnet-tutorial.

    When the code builds it says that everything is good and no reference errors. As soon as you run dotnet run then the references are underlined and the below error occurs.

    image

    I am not sure if this is a bug with visual studios or ML.NET. Any assistance would be helpful.

    Microsoft Visual Studio Community 2017
    Version 15.7.5
    VisualStudio.15.Release/15.7.5+27703.2042
    Microsoft .NET Framework
    Version 4.7.03056

    Thanks.

  14. eerhardt commented on Aug 13, 2018

    @eerhardt
    Member

    @carldupreez111 can you show your .csproj file? Also, make sure you target x64. You can’t use AnyCPU.

    One last thing: when you say ‘dotnet run’ you mean from the command line? What happens if you just hit F5 in VS?
    If you are using the command line, can you show the output of ‘dotnet -- info’

  15. carldupreez111 commented on Aug 13, 2018

    @carldupreez111

    If I use F5 it does the same thing as if I run dotnet run in the command line.

    Below is my .csproj file contents

    <Project Sdk="Microsoft.NET.Sdk">
    
      <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>netcoreapp2.1</TargetFramework>
    	<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Microsoft.ML" Version="0.4.0" />
      </ItemGroup>
    
      <ItemGroup>
        <None Update="iris.data.txt">
          <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </None>
      </ItemGroup>
    
    </Project>
    

    This is from the command line "dotnet --info".

    .NET Core SDK (reflecting any global.json):
     Version:   2.1.302
     Commit:    9048955601
    
    Runtime Environment:
     OS Name:     Windows
     OS Version:  10.0.17134
     OS Platform: Windows
     RID:         win10-x64
     Base Path:   C:\Program Files\dotnet\sdk\2.1.302\
    
    Host (useful for support):
      Version: 2.1.2
      Commit:  811c3ce6c0
    
    .NET Core SDKs installed:
      2.1.104 [C:\Program Files\dotnet\sdk]
      2.1.200 [C:\Program Files\dotnet\sdk]
      2.1.202 [C:\Program Files\dotnet\sdk]
      2.1.302 [C:\Program Files\dotnet\sdk]
    
    .NET Core runtimes installed:
      Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
      Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    
    To install additional .NET Core runtimes or SDKs:
      https://aka.ms/dotnet-download
    

    I did change the solution platform to x64 and pushed F5 and seems to run. Thanks, I was aware that you need to make sure its set to x64.

    Thanks for the assistance.

  16. eerhardt commented on Aug 14, 2018

    @eerhardt
    Member

    Closing as I believe the original issue/questions have been addressed.

  17. ghost locked as resolved and limited conversation to collaborators on Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions