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 为什么dotnet运行与VS代码调试完全不同_Visual Studio Code_.net Core - Fatal编程技术网

Visual studio code 为什么dotnet运行与VS代码调试完全不同

Visual studio code 为什么dotnet运行与VS代码调试完全不同,visual-studio-code,.net-core,Visual Studio Code,.net Core,我使用dotnet new-t web启动了一些未经修改的项目。我尝试使用VS代码V1.8.1和dotnet restore进行恢复。从我在dot.net和mva.microsoft.com上学习的教程来看,在这一点上,项目应该没有任何区别。我想那是对的,我没有修改这个项目。当我使用dotnet run在同一浏览器中运行同一个新项目时,然后打开浏览器,图像的左侧就是预期的结果。当我尝试使用F5或按VS代码上的run按钮运行时,结果就是图像的右侧。我和女儿一起看《埃尔莫》的所有实践都帮助我得出这样

我使用dotnet new-t web启动了一些未经修改的项目。我尝试使用VS代码V1.8.1和dotnet restore进行恢复。从我在dot.net和mva.microsoft.com上学习的教程来看,在这一点上,项目应该没有任何区别。我想那是对的,我没有修改这个项目。当我使用dotnet run在同一浏览器中运行同一个新项目时,然后打开浏览器,图像的左侧就是预期的结果。当我尝试使用F5或按VS代码上的run按钮运行时,结果就是图像的右侧。我和女儿一起看《埃尔莫》的所有实践都帮助我得出这样的结论:其中一件事情与另一件不同

最直接的原因是VS代码运行站点时没有对必要资源(如引导CSS文件)的有效引用。错误地,VS代码在http://localhost:5000/lib/bootstrap/dist/css/bootstrap.css,而使用dotnet运行项目会更有成效,并使用以下外部URL:https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/css/bootstrap.min.css. 这是一个最终会被修复的bug吗?是否有一些文档可以帮助修复这个bug

从.vscode文件夹的外观和到目前为止的注释来看,tasks.json文件似乎是一个关键区别。以下是文件内容:

{
    "version": "0.1.0",
    "command": "dotnet",
    "isShellCommand": true,
    "args": [],
    "tasks": [
        {
            "taskName": "build",
            "args": [
                "${workspaceRoot}\\project.json"
            ],
            "isBuildCommand": true,
            "problemMatcher": "$msCompile"
        }
    ]
}
以下是launch.json文件:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (web)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.0\\Avalon.dll",
            "args": [],
            "cwd": "${workspaceRoot}",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart",
            "launchBrowser": {
                "enabled": true,
                "args": "${auto-detect-url}",
                "windows": {
                    "command": "cmd.exe",
                    "args": "/C start ${auto-detect-url}"
                },
                "osx": {
                    "command": "open"
                },
                "linux": {
                    "command": "xdg-open"
                }
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            },
            "sourceFileMap": {
                "/Views": "${workspaceRoot}/Views"
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command.pickProcess}"
        }
    ]

我也有同样的问题

解决办法如下:

要么运行:

凉亭安装 为此,您需要安装nodejs和git

从安装Node.jshttps://nodejs.org/ 从安装githttps://git-scm.com/

npm安装-g bower 凉亭安装

或打开_Layout.cshtml,并将第9行更改为: 请看下面对此问题的更深入解释:

问候,,
托马斯

我也有同样的问题

解决办法如下:

要么运行:

凉亭安装 为此,您需要安装nodejs和git

从安装Node.jshttps://nodejs.org/ 从安装githttps://git-scm.com/

npm安装-g bower 凉亭安装

或打开_Layout.cshtml,并将第9行更改为: 请看下面对此问题的更深入解释:

问候,,
Thomas

转到.vscode文件夹并分析那里的调试设置。如果您不知道什么应该是正确的,请将当前文件内容作为问题的一部分发布。转到.vscode文件夹并分析那里的调试设置。如果你不知道什么应该是正确的,把当前的文件内容作为问题的一部分发布出来。
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/css/bootstrap.css" />