1. Directory structure
2. Run this command to restore the new MVC file structure
dotnet New Sln-n project file name without suffix name CD Web folder name dotnet new MVC
Generate the corresponding DLL file
3, Configuration Launch.json
1 {2 //use IntelliSense to understand related properties. 3 //hover to view the description of an existing property. 4 //For more information, please visit: https://go.microsoft.com/fwlink/?linkid=8303875"Version": "0.2.0",6"Configurations": [7 {8"Name": ". NET Core Launch (web)",9"Type": "CoreCLR",Ten"Request": "Launch", One"Prelaunchtask": "Build", A"Program": "${workspacefolder}/web folder name/bin/debug/netcoreapp2.0/web folder name". dll ", -"Args": [], -"CWD": "${workspacefolder}/web folder name", the"Stopatentry":false, -"Internalconsoleoptions": "Openonsessionstart", -"Launchbrowser": { -"Enabled":true, +"args": "${auto-detect-url}", -"Windows": { +"Command": "cmd.exe", A"args": "/C start ${auto-detect-url}" at }, -"OSX": { -"Command": "Open" - }, -"Linux": { -"Command": "Xdg-open" in } - }, to"Env": { +"Aspnetcore_environment": "Development" - }, the"Sourcefilemap": { *"/views": "${workspacefolder}/views" $ }Panax Notoginseng }, - { the"Name": ". NET Core Attach", +"Type": "CoreCLR", A"Request": "Attach", the"ProcessId": "${command:pickprocess}" + } - ] $}
4. Modify the configuration Tasks.json file
1 {2 //See https://go.microsoft.com/fwlink/?LinkId=7335583 //For the documentation about the Tasks.json format4"Version": "2.0.0",5"Tasks": [6 {7"Label": "Build",8"Command": "Dotnet Build",9"Type": "Shell",Ten"Group": "Build", One"Presentation": { A"Reveal": "Silent" - }, -"Options":{ the"CWD": "${workspaceroot}/web folder name" - }, -"Problemmatcher": "$msCompile" - } + ] -}
Then you can have a pleasant debug run! ^_^
Vscode Net Core 2.0 MVC