Creating Files in Visual Studio
My teacher wanted me to create other files that are cs similar to his in the screenshot. Although when I go to create the file I don't have the same option
35 Replies
you have to open the solution, you've open the folder
you can double click on the sln file from your windows explorer
Did you create the project via VS?
Close VS, open the project in the explorer
Make sure you have an
.sln
file, a .csproj
file, and at least one .cs
file
Double-click the .sln
If it works, cool. If it doesn't, let us know because it means it's a common bug with a simple fix
Or just disappear, that's cool as wellI cant even fine the sln file
you mean like explorer?
Yes, the file explorer
For example
okay I found it via irhgt lcick
And are the files I mentioned there?
Yes
double clicked and opened
Aight, seems like the path issue then
Try this quick fix: $dotnetpath
* Open
powershell
in a terminal in admin mode as in the following video:
https://cdn.discordapp.com/attachments/569261465463160900/1157744344183341156/20230930-1822-10.7436061.mp4
* copy/paste the following script
* it will tell you if it detects invalid Path
setup
* Press Enter to confirm
@TeBeCo let's hope your new and improved version works
hold on for some reason it doesnt want to copy n past e
If you see no output, then it seems like it's not the issue, huh...
What does the
dotnet --list-sdks
command say?
And dotnet --info
?Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Might be worth adding an
else
with some "Everything seems fine"
message so at least we know the code ran lolUnknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Alas
In any case, everything seems fine in the screenshot
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Or right-click the solution, click "add existing", and point it to the
.csproj
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Although if everything's been created via VS, the project should've been added to the solution automatically
that's what I got back
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
that's wwhat it looks like inside the folder
ohhh opening the .csproj
Ah, so the project simply wasn't added to the solution
Good, good
Yeahhh crazy lol
Now I can add the class
thanks guys
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
✅ Command successful. Updated tag 'dotnetpath'.