Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/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
Visual studio code 如何更改VSCode的.Net Core 2调试器端口_Visual Studio Code_Asp.net Core 2.0_Vscode Tasks - Fatal编程技术网

Visual studio code 如何更改VSCode的.Net Core 2调试器端口

Visual studio code 如何更改VSCode的.Net Core 2调试器端口,visual-studio-code,asp.net-core-2.0,vscode-tasks,Visual Studio Code,Asp.net Core 2.0,Vscode Tasks,我正在使用Visual Studio代码(VSCode)编写.Net Core 2.0应用程序,并希望使用VSCode调试器进行此操作。我创建了一个launch.json,它与我的前端代码一起工作,但我还想调试.Net代码。然而,我的主要问题是我没有使用默认端口(我认为默认情况下是5000)。那么我如何更改端口 { "version": "0.2.0", "configurations": [ { "name": ".NET Core Launch (Manageme

我正在使用Visual Studio代码(VSCode)编写.Net Core 2.0应用程序,并希望使用VSCode调试器进行此操作。我创建了一个
launch.json
,它与我的前端代码一起工作,但我还想调试
.Net
代码。然而,我的主要问题是我没有使用默认端口(我认为默认情况下是5000)。那么我如何更改端口

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": ".NET Core Launch (Management.Core)",
      "type": "coreclr",
      "request": "launch",
      "preLaunchTask": ".Net Build (all)",
      "program": "${workspaceRoot}/Management.Core/bin/Debug/netcoreapp2.0/Management.Core.dll",
      "args": [],
      "cwd": "${workspaceRoot}/CpaManagement.Core",
      "stopAtEntry": false,
      "console": "internalConsole"
    },
}
我试图添加一个
端口:12345
,但这不是一个可接受的属性。我还尝试添加
args:['--port=12345']
,但也不起作用

My.Net Core应用程序
启动设置.json
如下配置:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:8888/",
      "sslPort": 45678
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "api/values",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "Web": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "api/values",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:12345/"
    }
  }
}

另外,问题中显示的端口与我使用的端口不完全相同,但这对问题本身并不重要

如果是关于web应用程序,那么您应该在
launch.json中的文件夹.vscode中查找行:

"env": {
 "ASPNETCORE_ENVIRONMENT":"Development"
},
并在“ASPNETCORE\u环境”之后添加“开发”
,即:
“ASPNETCORE\u URL”:http://localhost:xxxx“
where xxxx-您要使用的端口。

我正在为Mac使用Visual Studio代码1.25,并在属性文件夹下的launchSettings.json中更改端口号对我有效

将此环境元素放置在何处?这对我不起作用。浏览器仍在默认端口5000打开。需要编辑.vscode文件夹中的launch.json。看看这个屏幕截图->事情一定变了,我在launchSettings.json中找到了端口信息