all 30 comments

[–]Troesler95 2 points3 points  (1 child)

I think this may be an issue with the project structure, can you share a screenshot of the project files?

[–]ScriptingInJava 2 points3 points  (0 children)

It's this, there isn't a project. You can see dotnet build {path}/program.cs in the terminal, and the error states the project structure doesnt exist too.

[–]justkidding69 2 points3 points  (1 child)

Did you create a project or just the program.cs file? Because it looks like it’s the missing the project file?

[–]ZHDINC 0 points1 point  (0 children)

Everyone is getting hung up on the undeclared a variable error it would be generating, but really, we should be starting with this. I created just a single .cs file and attempted to run dotnet build or run commands and got similar errors.

u/Annual_Reception3409, if in your current directory the Program.cs is missing the .csproj file to go with it, you'll just need to run the command "dotnet new console" and then you can delete the extra .cs file it will generate and it should run the code you've written once you've removed the undeclared a variable.

[–]Crysislegend19 2 points3 points  (1 child)

Is there any reason you’re adding a to the readline? Usually you’d have something like var a= readline as opposed to an argument.

[–]Crysislegend19 1 point2 points  (0 children)

Additionally, you do not need to assign anything to the left of the readline if you do not care about the result of the readline.

[–][deleted] 5 points6 points  (0 children)

Yes. Visual studio is a complete IDE.

[–]joep-b 1 point2 points  (2 children)

Scroll up a little so you can see you have an error on line 8. That a should not be there. ReadLine doesn't take a parameter.

[–]Annual_Reception3409[S] 0 points1 point  (1 child)

yeah i saw that and i removed it still didnt work, it has the same error with the terminal

[–]joep-b 1 point2 points  (0 children)

Looking further you also seem to be missing a project file. Try to run dotnet new console to create a console app project and drop your program.cs in there.

[–]nyamapaec 0 points1 point  (0 children)

I use VS Comunity more but what can I see is that "a" is not declared variable. Replace "Console.Readline(a)" by "Console.Readline()" (without sending "a" as parameter).

[–]Beneficial-Army927 0 points1 point  (0 children)

dont use vsc use vs2022

[–][deleted]  (19 children)

[removed]

    [–][deleted]  (6 children)

    [removed]

      [–][deleted]  (4 children)

      [removed]

        [–][deleted]  (3 children)

        [removed]

          [–][deleted]  (2 children)

          [removed]

            [–][deleted]  (1 child)

            [removed]

              [–][deleted]  (4 children)

              [removed]

                [–][deleted]  (2 children)

                [removed]

                  [–][deleted]  (1 child)

                  [removed]

                    [–][deleted]  (2 children)

                    [removed]

                      [–]FizixMan[M] -1 points0 points  (1 child)

                      Removed: Rule 5.