Stupid question about Visual Studio
Hello everyone, I feel like I'm losing my mind with Microsoft Visual Studio. My college wants me to rename the .cs file in the solution explorer but I don't see anything like presented on the screenshot with instructions (picture in light mode). Official microsoft guide has solution with project (1 out of 1), and c# program tab with Dependencies and Program.cs in it, but I have empty solution. Any good videos on how to configure this? Spent 2 hours trying to configure Visual Studio and so far having only trouble.
59 Replies
you could paste solution file here
There is no solution file
you have to have at least a csproj
There are in fact no files at all, it doesn't let me do anything, I have Console.WriteLine written there, but it doesn't let me run or debug, just "Attach..."
Is it just a loose
.cs
file?
Or do you have a proper project with a .csproj
and all set up?No, I made a project
Is it in "views"?
It's on your disk
Aight, that seems fine
And did you open the project, the solution, or the folder?
Just to make sure, close VS and open the solution by double-clicking the
.sln
fileDid that, everything seems same, so I guess it was solution opened
Still cant run anything tho
Huh
Try opening it by double-clicking on the csproj?
Maybe the solution file is busted
Ah
Now we're getting somewhere
Open the csproj in any text editor (Notepad, Notepad++, etc) and paste the contents here
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
Aight
Open Powershell or CMD and execute
dotnet --info
command, paste the output hereHost:
Version: 8.0.1
Architecture: x86
Commit: bf5e279d92
RID: win-x86
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.26 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x64 [C:\Program Files\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
dotnet command - .NET CLI
Learn about the dotnet command (the generic driver for the .NET CLI) and its usage.
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.
Seems you have no .NET SDK installed, just the runtime
Is it supposed to be installed separately from Visual Studio?
It should be installed with VS, yeah
Perhaps you're missing a workload?
Open the VS installer and check that you have it
It should be something like "programming classic applications for .NET platform"
In the installer, click on
Modify
buttonHuh, so it is there
What's the VS version?
2022
And this?
.4
but yeah
Yeah that's good
Aight, let's try to install the SDK separately
You can download it and run the installer, or use the Winget package manager and
winget install dotnet-sdk-8
Alright, getting installed
Is it somehow related to azure?
Not at all
I mean, maybe MS is storing the installer or something on Azure, they probably are
But nothing directly tied to it
Typical microsoft
Alright, SDK's installed
Cool
Close the cmd/pwsh, reopen it,
dotnet --info
again
Or even just dotnet --list-sdks
No SDKs found
Well damn
Okay, it could be an issue with env variables then
do you need to be admin to install it? probably not but just checking
Ah
So it's most probably is an issue with the
PATH
variable
Open the environmental variables editor in control panel
Typing edit environmental variables
in the start menu should get you directly thereThis?
Yep
Click that
Enviromnent Variables
buttonUnknown User•11mo ago
Message Not Public
Sign In & Join Server To View
* 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
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Or use pwsh, sure lol
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Alr, so run the script, now sdk's should be in place?
Yep
yyeeaaahhh, sdk 8 installed
Nice
very based
and now I have dependencies and all that stuff from youtube tutorials
Thank you very much guys, big help, I'd probably bash my head on the wall for whole day without you
As a side note, I wonder if putting it somewhere online and changing the bot message to use
iex
would be less intimidating lol
It's an all too common issue for... some reasonUnknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Microsoft magic
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Instead of the wall of code it'd be
or w/e
Yeah
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Ah, nice, I copied from Chocolatey lol
I think
might also work
But all that's just bikeshedding
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
mean, it's already possible, might as well make it more ergonomic lol
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
I wonder if there's an issue I could upvote...