Skip to content

error CS0103: The name 'File' does not exist in the current context #2503

Description

@iamgauravarora

System Information (please complete the following information):

  • Model Builder or CLI Version: 16.14.3
  • Visual Studio Version (if applicable):

Describe the bug

~/myMLApp/SentimentModel/SentimentModel.training.cs(62,29): error CS0103: The name 'File' does not exist in the current ~/myMLApp/SentimentModel/SentimentModel.csproj]

The build failed. Fix the build errors and run again.

To Reproduce
Steps to reproduce the behavior:

  1. Following steps in URL https://dotnet.microsoft.com/en-us/learn/ml-dotnet/get-started-tutorial/consume
  2. In step 3 run the console application using dotnet run
  3. See the error: ~/myMLApp/SentimentModel/SentimentModel.training.cs(62,29): error CS0103: The name 'File' does not exist in the current ~/myMLApp/SentimentModel/SentimentModel.csproj]

Expected behavior
The console app should run without error

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Possible solution: Add 'using System.IO;' in SentimentModel/SentimentModel.training.cs file

Screenshot 2023-02-21 at 1 26 26 AM

Activity

  1. beccamc commented on Feb 22, 2023

    @beccamc
    Contributor

    CLI generated project is missing the System.IO using.

  2. luisquintanilla commented on Mar 6, 2023

    @luisquintanilla
    Contributor

    Thanks for looking into this @beccamc. Throwing it in the backlog.

  3. added this to the March 2023 milestone on Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GS TutorialBug from customer using Getting Started TutorialPriority:0Work that we can't release withoutStale

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions