このプロジェクト、ASP.NET MVC5 WebApi があり、Visual Studio 2015 を使用して作成されました。
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
一時的に VS2015 を使用できなくなったため、現在は Visual Studio Code で作業しています。
作業に必要なほとんどすべてを構成できました。OmniSharp は正常に動作しているため、IntelliSense があり、msbuild でソリューションを構築し、IIS Express を実行して作業をテストできます。debug以外に必要なものはすべて. =/
実際にvscodeをiisexpressインスタンスにアタッチすることはできますが、シンボルが読み込まれていないことを示すブレークポイントが灰色のままになります。アタッチ構成でsymbolPathを使用しようとしましたが、成功しませんでした。
すべてのデバッグ コンソールには次のように表示されます。
--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
clrdbg は .NET 4.5.2 をターゲットにできないのでしょうか? シンボルをロードする方法についてもっと情報が必要なのかもしれません。iisexpress コマンド ラインのディレクティブが不足している可能性がありますか?
どんな助けでも大歓迎です。ありがとう。:)
これが私が構築する方法です:(どちらも正常に動作します)
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "cmd",
"isShellCommand": true,
"args": ["/c"],
"showOutput": "always",
"tasks": [
{
"taskName": "build",
"isBuildCommand": true,
"suppressTaskName": true,
"args": [
"dotnet build",
"${workspaceRoot}\\MyWebApi.sln"
],
"showOutput": "always",
"problemMatcher": "$msCompile"
},
{
"taskName": "build with msbuild",
"isBuildCommand": true,
"suppressTaskName": true,
"args": [
"C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe",
"${workspaceRoot}\\MyWebApi.sln",
"/p:Configuration=Debug;GenerateFullPaths=true",
"/t:Rebuild",
"/m",
"/v:m",
"/property:GenerateFullPaths=true"
],
"showOutput": "always",
"problemMatcher": "$msCompile"
}
]
}
iisexpress を実行する方法は次のとおりです。
"C:\Program Files\IIS Express\iisexpress.exe" /config:".\.vs\config\applicationhost.config" /site:MyWebApi /apppool:Clr4IntegratedAppPool /trace:e
ここで私が添付する方法:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to IIS Express",
"type": "coreclr",
"request": "attach",
"processName": "iisexpress"
}
]
}