CSharp VSCode: Difference between revisions
Jump to navigation
Jump to search
Created page with "=Introduction= This page is to capture the issues using c# with VS Code =SDK Error= So the main purpose of this page<br> 300px<br> Don't like solving problems twice but though MS would have solved it for me. So here we go" |
|||
(One intermediate revision by the same user not shown) | |||
Line 4: | Line 4: | ||
So the main purpose of this page<br> | So the main purpose of this page<br> | ||
[[File:SDK Error.png|300px]]<br> | [[File:SDK Error.png|300px]]<br> | ||
Don't like solving problems twice but though MS would have solved it for me. So here we go | Don't like solving problems twice but though MS would have solved it for me. So here we go. So copilot was has to solve this | ||
<syntaxhighlight lang="bash"> | |||
sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet | |||
export PATH=$PATH:/snap/bin | |||
</syntaxhighlight> | |||
Obviously you need to update the .bashrc or what ever appropriately. '''BUT THIS DID NOT WORK'''. This subsequently fails with GLIBC_PRIVATE not defined error in dotnet SDK when installed via snap<br> | |||
To solve this I ended up install via apt. This was on Ubuntu 24.04 | |||
<syntaxhighlight lang="bash"> | |||
sudo apt install dotnet-sdk-8.0 | |||
</syntaxhighlight> | |||
Once installed I did have to change by launch file to get debugging to work. This might be cause it was originally wrong but this is a reminder to myself. | |||
<syntaxhighlight lang="json"> | |||
{ | |||
"version": "0.2.0", | |||
"configurations": [ | |||
{ | |||
"name": ".NET Core Launch (web)", | |||
"type": "coreclr", | |||
"request": "launch", | |||
"preLaunchTask": "build", | |||
"program": "${workspaceFolder}/Catalog.Api/bin/Debug/net8.0/Catalog.Api.dll", | |||
"args": [], | |||
"cwd": "${workspaceFolder}", | |||
"stopAtEntry": false, | |||
"serverReadyAction": { | |||
"action": "openExternally", | |||
"pattern": "\\bNow listening on:\\s+(https?://\\S+)" | |||
}, | |||
"env": { | |||
"ASPNETCORE_ENVIRONMENT": "Development" | |||
}, | |||
"sourceFileMap": { | |||
"/Views": "${workspaceFolder}/Views" | |||
} | |||
}, | |||
{ | |||
"name": ".NET Core Attach", | |||
"type": "coreclr", | |||
"request": "attach" | |||
}, | |||
{ | |||
"name": "Docker .NET Launch", | |||
"type": "docker", | |||
"request": "launch", | |||
"preLaunchTask": "docker-run: debug", | |||
"netCore": { | |||
"appProject": "${workspaceFolder}/Catalog.Api.csproj" | |||
} | |||
} | |||
] | |||
} | |||
</syntaxhighlight> |
Latest revision as of 20:53, 20 February 2025
Introduction
This page is to capture the issues using c# with VS Code
SDK Error
So the main purpose of this page
Don't like solving problems twice but though MS would have solved it for me. So here we go. So copilot was has to solve this
sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet
export PATH=$PATH:/snap/bin
Obviously you need to update the .bashrc or what ever appropriately. BUT THIS DID NOT WORK. This subsequently fails with GLIBC_PRIVATE not defined error in dotnet SDK when installed via snap
To solve this I ended up install via apt. This was on Ubuntu 24.04
sudo apt install dotnet-sdk-8.0
Once installed I did have to change by launch file to get debugging to work. This might be cause it was originally wrong but this is a reminder to myself.
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Catalog.Api/bin/Debug/net8.0/Catalog.Api.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
},
{
"name": "Docker .NET Launch",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"netCore": {
"appProject": "${workspaceFolder}/Catalog.Api.csproj"
}
}
]
}