210 Replies
$vscode
Follow the instructions here on getting started with DevKit for C# in VSCode: https://code.visualstudio.com/docs/csharp/get-started
Get started with C# and .NET in Visual Studio Code
Getting Started with C# and .NET Development in Visual Studio Code
I can't download .Net
What happens that prevents you from doing it?
I don't know. I did everything according to the instructions, but it still does not work for me. Let's go to ds and you will tell me what to do
what does "it doesn't work" mean?
Please someone join me on the bell and help me set up Visual Studio Code
it's not gonna help if you can't explain what's not working
I did everything that is written in the instructions, but every time it crashes
and says what?
or failed to start or does not find the file in everything
i don't think that's literally what it says
You need to put in some minimum level of effort for us to help.
Let's go to the bell and I'll show you. My English is bad
i'm not joining voice
assuming that's what "bell" is supposed to mean
This is first
It is written there. Open debug solution folder
@jimmacle
Do you have a C# project that you opened?
Or is it just a loose
.cs
file?i clicked create file
C# is based on projects, you can't run a standalone .cs file
dotnet new console
in the terminal will create a new console projectplease tell me where i should click to do
i created a new project
okay, so open that folder in vs code
(i would also really recommend using VS and not VS Code)
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
Microsoft
.NET Downloads (Linux, macOS, and Windows)
Official .NET downloads for Linux, macOS, and Windows. .NET is a free, cross-platform, open-source developer platform for building many different types of applications.
Well, do you have an SDK installed?
Or just the runtime?
I have two
open a terminal and write
dotnet --info
and show us the resultyeah, no SDK installed
how to install?
and you have two old runtimes that are x86 installed
that should work
could this be another case of PATH ordering?
i know it happens with VS installs, idk about plain SDK installs
not yet, it should have listed it as alternative install
but we might end up there, because of the runtimes
My problem is that I download, but nothing happens
this box should have listed the x64 installation
My russian isn't very good, but that seems okay?
yes
open up
C:\Program Files\dotnet
and show me what you got in thereand in the SDKs folder?
sdk
okay
lets try the PATH thing
what is it?
press windows+R
I'll come in 5 seconds
rundll32.exe sysdm.cpl,EditEnvironmentVariables
farther
are you looking at a window with two big white boxes?
yes
kinda like this
+
yes
so, in the bottom list
find the one called
PATH
or Path
i find
then click edit
ah, its grayed out
we must open the window another way
close it down, press windows key and write something like "system environment variables"
for me 😄
"Edit system environmentvariables"
I don't have that
you do, its just called something different in russian
ok, open the control panel instead
translate is so bad
controlnya panel
ok
i open
and then "System"
and then "advanced system settings"
this
da!
the bottom button,
should open the same window as before, but we can now edit the path
ye
da
yes
good
show me your list
okay, the bottom one
click that, then press "move up"
5 times
the lowest
yes
C:\Program Files\dotnet
did
needs to be above
C:\Program Files (x86)\dotnet
show nowdid
show me
ya hasho smatrit
no, the list
this, again
dima, slisho minya
show me the list of your Path variable again
after you made the changes
samt
I need to check that its correct
harasho
close it all down
close any terminal windows, close VS Code
open a new terminal and do
dotnet --info
againshow the full thing
all of it
harasho!
now,
dotnet new console
that will create a new project
Always create your projects via dotnet new
dotnet run
and it will run your programthe file I downloaded from the site?
no?
now you write your own programs
the SDK is installed and working
the problem was your Path
we fixed it
?
where should I click to launch?
no click
dotnet run
you can install the devkit now, if you want
$vscodeFollow the instructions here on getting started with DevKit for C# in VSCode: https://code.visualstudio.com/docs/csharp/get-started
Get started with C# and .NET in Visual Studio Code
Getting Started with C# and .NET Development in Visual Studio Code
but we've fixed your dotnet installation, so now you can make things
remove "test1.cs"
ty sdelal harasho dima, ya gorzhus tebya
which one should I write in?
Program.cs
C#... osnovan(?) na proyekte, ne na faylexD
I write Spasibo
but programme write Hello World
did you save file?
no
save the file, try again 🙂
......
well, do what the error is telling you
это приложение столько хлопот мне дало
i mean, you have to write valid C# code for it to compile and run
i dont no
you don't need to touch that file
problem isnt with vscode right now, its your code
you need to fix the syntax errors in your code
maybe it's time to try a C# tutorial
$helloworld
Written interactive course https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/tutorials/
Videos https://dotnet.microsoft.com/learn/videos
did you save?
ye
i don't think so
because
Console.Writeline
is not a method and should give you a different error^
the screenshot also has the "modified file" indicator for
Program.cs
i save
nazmite ctrl+s
you did not
that white ball means its modified and not saved
side question, why isn't VSC showing any diagnostics for these errors in the editor
'Console' does not contain a definition for 'Writeline'
correct
the method is called
WriteLine
not Writeline
WriteLine
L
not
l
Big
L
= yes
Small l
= noDa
всё равно ошибка
still a mistake
show error
error CS0117: "Console" не содержит определение для "Writeline". [D:консольконсоль.csproj]
Did you save
.
you did not save again
you have to save your file every time you change it before compiling again
or enable auto save
i have autosave on in rider and still mash ctrl+s out of habit
It's a terrible app. I clicked save six times and nifiga
same in every IDE or Editor for me
this seems like user error
xD
i have never had a problem saving files in vs code
VS Code might not be the best IDE there is, but it does save files, I assure you
but yeah if it's that terrible just use VS
I am a novice programmer. I'm going to college and that's why I decided to start studying
Visual Studio
Visual Studio 2022 Community Edition – Download Latest Free Version
Try our free, fully-featured, and extensible IDE for creating modern developer apps for Windows, Android, & iOS. Download Community for free today!
use this instead
I tried to set up Visual Studio for a month, and then I tried Visual code
visual studio is more beginner friendly
In Visual Studio, he writes to me that the version does not fit
try it again now that we fixed your SDK paths
ok
weird, VS Code works perfectly for me, its not a terrible app
let's wait
i definitely don't like VSC but it's usable at least
dotnet run isnt even a vscode thing
I wrote that I need to update the version of the code
you can even run it in command prompt
it is for beginners honestly. If you arent comfortable in using the CLI and know what a csproj is and everything you are lost
no, VS Code is not beginner friendly
I meant it is terrible for beginners
and this is why we recommend VS 😄
i wish rider had a free option so we could recommend that instead
yeah
Молодец
Feel free to DM me if you need help 🇷🇺
Hello
I never managed to log in to Visual Studio
looks like you created a .net framework project
$newproject
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework.
.NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended.
https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
yes
follow this image
basically you have a syntax in ur code that is not supported in c# 7.3
I have two
yea choose the first one
Thank you
especially thanks to him. He sat with me for about 2 hours yesterday setting up
why write using System?
so you can detect the classes that are included in this Namespace,
Console
for example
if you dont write it,the compiler wouldn't know where to find this classmy code works without it
But in here you're in top level statement mode, so
using System;
is implicitly addedso I don't have to write this?
if you're in top level statement mode, then yes
what is this mode and where can I find or see it?
well, if you write code directly without the
public static void Main(string[] args)
method, it indicates u are already in that mode
this is not top level statement ^
but this is
its just sugar syntax , for people who dont want to define the class and declare the Main Methodlarge programs can also work without this, or will you have to memorize it?
You can only use it for your main method/file, any other .cs files you have need to contain the full syntax
yes you can work without this if you want. But you should still understand that its the exact same thing as if you would put all your top level statements inside a main method, jsut in case you face them in other people's code
you can press ctrl + period > convert to program main style or smth like that
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.