Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added VSCode debugging (for MvcSandbox) & code analysis support #29486

Merged
merged 8 commits into from
Apr 5, 2021
Prev Previous commit
Next Next commit
1. Convered some more projects.
2. Added env variable for TargetFramework and used it in launch.json file rather than
hardcoding TFW.
  • Loading branch information
ShreyasJejurkar committed Jan 31, 2021
commit c7a5c9e68f2a43b669242aad4028729cdce1ab98
3 changes: 3 additions & 0 deletions src/Antiforgery/startvscode.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF

%~dp0..\..\startvscode.cmd %~dp0
22 changes: 22 additions & 0 deletions src/Azure/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "AzureAppServicesHostingStartupSample",
"type": "coreclr",
"preLaunchTask": "AzureAppServicesHostingStartupSample-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/AzureAppServicesHostingStartupSample/Debug/${env:TARGET}/AzureAppServicesHostingStartupSample.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
},
]
}
19 changes: 19 additions & 0 deletions src/Azure/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "AzureAppServicesHostingStartupSample-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/samples/AzureAppServicesHostingStartupSample/AzureAppServicesHostingStartupSample.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
3 changes: 3 additions & 0 deletions src/Azure/startvscode.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF

%~dp0..\..\startvscode.cmd %~dp0
3 changes: 3 additions & 0 deletions src/Caching/startvscode.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF

%~dp0..\..\startvscode.cmd %~dp0
39 changes: 39 additions & 0 deletions src/Components/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "BlazorServerApp",
"type": "coreclr",
"preLaunchTask": "BlazorServerApp-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/BlazorServerApp/Debug/${env:TARGET}/BlazorServerApp.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
},
{
"name": "IgnitorSample",
"type": "coreclr",
"preLaunchTask": "IgnitorSample-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/IgnitorSample/Debug/${env:TARGET}/IgnitorSample.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
}
ShreyasJejurkar marked this conversation as resolved.
Show resolved Hide resolved
]
}
33 changes: 33 additions & 0 deletions src/Components/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "BlazorServerApp-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Samples/BlazorServerApp/BlazorServerApp.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "IgnitorSample-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Samples/IgnitorSample/IgnitorSample.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
3 changes: 3 additions & 0 deletions src/Components/startvscode.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF

%~dp0..\..\startvscode.cmd %~dp0
90 changes: 90 additions & 0 deletions src/DataProtection/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "CustomEncryptorSample",
"type": "coreclr",
"preLaunchTask": "CustomEncryptorSample-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/CustomEncryptorSample/Debug/${env:TARGET}/CustomEncryptorSample.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
},
{
"name": "EntityFrameworkCoreSample",
"type": "coreclr",
"preLaunchTask": "EntityFrameworkCoreSample-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/EntityFrameworkCoreSample/Debug/${env:TARGET}/EntityFrameworkCoreSample.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
},
{
"name": "KeyManagementSample",
"type": "coreclr",
"preLaunchTask": "KeyManagementSample-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/KeyManagementSample/Debug/${env:TARGET}/KeyManagementSample.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
},
{
"name": "NonDISample",
"type": "coreclr",
"preLaunchTask": "NonDISample-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/NonDISample/Debug/${env:TARGET}/NonDISample.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
},
{
"name": "Redis",
"type": "coreclr",
"preLaunchTask": "Redis-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/Redis/Debug/${env:TARGET}/Redis.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
}
]
}
75 changes: 75 additions & 0 deletions src/DataProtection/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "CustomEncryptorSample-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/samples/CustomEncryptorSample/CustomEncryptorSample.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "EntityFrameworkCoreSample-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/samples/EntityFrameworkCoreSample/EntityFrameworkCoreSample.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "KeyManagementSample-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/samples/KeyManagementSample/KeyManagementSample.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "NonDISample-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/samples/NonDISample/NonDISample.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Redis-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/samples/Redis/Redis.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
3 changes: 3 additions & 0 deletions src/DataProtection/startvscode.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF

%~dp0..\..\startvscode.cmd %~dp0
32 changes: 16 additions & 16 deletions src/Mvc/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "MvcSandbox",
"type": "coreclr",
"preLaunchTask": "MvcSandbox-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/MvcSandbox/Debug/net6.0/MvcSandbox.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
{
"name": "MvcSandbox",
"type": "coreclr",
"preLaunchTask": "MvcSandbox-build",
"request": "launch",
"program": "${workspaceFolder}/../../artifacts/bin/MvcSandbox/Debug/${env:TARGET}/MvcSandbox.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
},
]
}
30 changes: 15 additions & 15 deletions src/Mvc/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"version": "2.0.0",
"tasks": [
{
"label": "MvcSandbox-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/samples/MvcSandbox/MvcSandbox.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
"label": "MvcSandbox-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/samples/MvcSandbox/MvcSandbox.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
]
}
3 changes: 3 additions & 0 deletions startvscode.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ SET DOTNET_MULTILEVEL_LOOKUP=0
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
SET PATH=%DOTNET_ROOT%;%PATH%

:: Sets TFW for Visual Studio Code usage
SET TARGET=net6.0
captainsafia marked this conversation as resolved.
Show resolved Hide resolved

SET folder=%~1

IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
Expand Down