我有这个项目,ASP.NET MVC5 WebApi,它是使用 Visual Studio 2015 创建的。
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
碰巧我暂时无法使用 VS2015 工作,所以我现在正在使用 Visual Studio Code。
我能够配置我工作所需的几乎所有东西,OmniSharp 工作正常,所以我有智能感知,我能够使用 msbuild 构建解决方案并运行 IIS Express 来测试工作。除了调试之外我需要的一切。=/
我实际上可以将 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"
}
]
}