Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 运行应用程序时,在VSCode中的ASP.NET核心应用程序中启动特定URL_C#_Asp.net Core_Visual Studio Code_Vscode Settings - Fatal编程技术网

C# 运行应用程序时,在VSCode中的ASP.NET核心应用程序中启动特定URL

C# 运行应用程序时,在VSCode中的ASP.NET核心应用程序中启动特定URL,c#,asp.net-core,visual-studio-code,vscode-settings,C#,Asp.net Core,Visual Studio Code,Vscode Settings,(在Mac电脑上运行,如果有必要的话。) 在Visual Studio中,在运行或调试ASP.NET核心项目时,可以使用此方法启动特定URL。使用launchUrl属性。这是一个示例launchSettings.json文件: { "profiles": { "MyProjectName": { "commandName": "Project", "launchBrowser": true, "launchUrl": "customstartupu

(在Mac电脑上运行,如果有必要的话。)

在Visual Studio中,在运行或调试ASP.NET核心项目时,可以使用此方法启动特定URL。使用launchUrl属性。这是一个示例launchSettings.json文件:

{
  "profiles": {
    "MyProjectName": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "customstartupurlgoeshere/?id=theanswertotheuniverse",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:5001;http://localhost:5000"
    }
  }
}

VS代码中的模拟是什么?我读到VS代码忽略launchSettings.json文件

VSCode在启动程序时采用
.VSCode/launch.json
配置

已使用launchUrl属性。。。。VS代码中的模拟是什么

您可以更改
args
参数以接受
--url
的参数。例如,如果您想让红隼在
6001
/
6000
上收听:

"configurations": [ { "name": ".NET Core Launch (web)", "type": "coreclr", "request": "launch", "preLaunchTask": "build", "program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/App.dll", "args": ["--urls","https://localhost:6001;http://localhost:6000"], "cwd": "${workspaceFolder}", "stopAtEntry": false, "serverReadyAction": { "action": "openExternally", "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" }, "env": { "ASPNETCORE_ENVIRONMENT": "Development" }, "sourceFileMap": { "/Views": "${workspaceFolder}/Views" } }, “配置”:[ { “名称”:“.NET核心发布(web)”, “类型”:“coreclr”, “请求”:“启动”, “预启动任务”:“构建”, “程序”:“${workspaceFolder}/bin/Debug/netcoreapp3.0/App.dll”, “参数”:[“--URL”https://localhost:6001;http://localhost:6000"], “cwd”:“${workspaceFolder}”, “stopAtEntry”:false, “serverReadyAction”:{ “行动”:“对外开放”, “模式”:“^\\s*正在收听:\\s+(https?:/\\s+” }, “环境”:{ “ASPNETCORE_环境”:“开发” }, “sourceFileMap”:{ “/Views”:“${workspaceFolder}/Views” } },