C
C#•11mo ago
DragonKnightx137

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
No description
No description
35 Replies
x0rld 👻 🎃
you have to open the solution, you've open the folder you can double click on the sln file from your windows explorer
Angius
Angius•11mo ago
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 well
DragonKnightx137
DragonKnightx137OP•11mo ago
I cant even fine the sln file you mean like explorer?
Angius
Angius•11mo ago
Yes, the file explorer
Angius
Angius•11mo ago
For example
No description
DragonKnightx137
DragonKnightx137OP•11mo ago
okay I found it via irhgt lcick
Angius
Angius•11mo ago
And are the files I mentioned there?
DragonKnightx137
DragonKnightx137OP•11mo ago
Yes double clicked and opened
DragonKnightx137
DragonKnightx137OP•11mo ago
No description
Angius
Angius•11mo ago
Aight, seems like the path issue then Try this quick fix: $dotnetpath
MODiX
MODiX•11mo ago
* 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
iex "& { $(irm https://gist.githubusercontent.com/tebeco/5c6cc0eee8c28fad3523008d58f83914/raw/e4a8818e5caa0275cc49cc722cdfe0b65427b962/fix-dotnet-path.ps1) }"
iex "& { $(irm https://gist.githubusercontent.com/tebeco/5c6cc0eee8c28fad3523008d58f83914/raw/e4a8818e5caa0275cc49cc722cdfe0b65427b962/fix-dotnet-path.ps1) }"
Angius
Angius•11mo ago
@TeBeCo let's hope your new and improved version works when
DragonKnightx137
DragonKnightx137OP•11mo ago
hold on for some reason it doesnt want to copy n past e
DragonKnightx137
DragonKnightx137OP•11mo ago
No description
Angius
Angius•11mo ago
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
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
DragonKnightx137
DragonKnightx137OP•11mo ago
No description
Angius
Angius•11mo ago
Might be worth adding an else with some "Everything seems fine" message so at least we know the code ran lol
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius•11mo ago
Alas In any case, everything seems fine in the screenshot
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius•11mo ago
Or right-click the solution, click "add existing", and point it to the .csproj
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius•11mo ago
Although if everything's been created via VS, the project should've been added to the solution automatically
DragonKnightx137
DragonKnightx137OP•11mo ago
that's what I got back
No description
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
DragonKnightx137
DragonKnightx137OP•11mo ago
that's wwhat it looks like inside the folder
No description
No description
DragonKnightx137
DragonKnightx137OP•11mo ago
ohhh opening the .csproj
DragonKnightx137
DragonKnightx137OP•11mo ago
No description
Angius
Angius•11mo ago
Ah, so the project simply wasn't added to the solution Good, good
DragonKnightx137
DragonKnightx137OP•11mo ago
Yeahhh crazy lol Now I can add the class thanks guys
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX•11mo ago
✅ Command successful. Updated tag 'dotnetpath'.
Want results from more Discord servers?
Add your server