Closed neilhuiz closed 8 years ago
To add insult to injury, the above fix does get the debugger installed, but all attempts to debug result in an error message: Debug adapter process has terminated unexpectedly
@DustinCampbell is there somewhere I can hunt for log files to give me a clue as to what is going on? The only log file I found in the extension's directory is the debugger install log.
Add the following logging section to your launch.json debug configuration to see verbose debugger logging:
"configurations": [
{
"name": ".NET Core Launch (console)",
...
"logging": {
"engineLogging": true,
"trace": true,
"traceResponse": true
}
...
The output will appear in the debug console, please paste the results back here.
Added the settings, restarted code and tried debugging again. There is no output in the debug console, just the error banner.
can you give me a directory listing for %USERPROFILE%\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug\debugAdapters\
?
Sure thing.
C:\>dir /b %USERPROFILE%\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug\debugAdapters\*
1033
API-MS-Win-Base-Util-L1-1-0.dll
api-ms-win-core-com-l1-1-0.dll
api-ms-win-core-com-private-l1-1-0.dll
api-ms-win-core-comm-l1-1-0.dll
api-ms-win-core-console-l1-1-0.dll
api-ms-win-core-console-l2-1-0.dll
api-ms-win-core-datetime-l1-1-0.dll
api-ms-win-core-datetime-l1-1-1.dll
api-ms-win-core-debug-l1-1-0.dll
api-ms-win-core-debug-l1-1-1.dll
api-ms-win-core-delayload-l1-1-0.dll
api-ms-win-core-errorhandling-l1-1-0.dll
api-ms-win-core-errorhandling-l1-1-1.dll
api-ms-win-core-fibers-l1-1-0.dll
api-ms-win-core-fibers-l1-1-1.dll
api-ms-win-core-file-l1-1-0.dll
api-ms-win-core-file-l1-2-0.dll
api-ms-win-core-file-l1-2-1.dll
api-ms-win-core-file-l2-1-0.dll
api-ms-win-core-file-l2-1-1.dll
api-ms-win-core-handle-l1-1-0.dll
api-ms-win-core-heap-l1-1-0.dll
api-ms-win-core-heap-obsolete-l1-1-0.dll
api-ms-win-core-interlocked-l1-1-0.dll
api-ms-win-core-io-l1-1-0.dll
api-ms-win-core-io-l1-1-1.dll
api-ms-win-core-kernel32-legacy-l1-1-0.dll
api-ms-win-core-kernel32-legacy-l1-1-1.dll
api-ms-win-core-kernel32-legacy-l1-1-2.dll
API-MS-Win-Core-Kernel32-Private-L1-1-0.dll
API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
API-MS-Win-Core-Kernel32-Private-L1-1-2.dll
api-ms-win-core-libraryloader-l1-1-0.dll
api-ms-win-core-libraryloader-l1-1-1.dll
api-ms-win-core-localization-l1-2-0.dll
api-ms-win-core-localization-l1-2-1.dll
api-ms-win-core-localization-l2-1-0.dll
api-ms-win-core-localization-obsolete-l1-2-0.dll
api-ms-win-core-memory-l1-1-0.dll
api-ms-win-core-memory-l1-1-1.dll
api-ms-win-core-memory-l1-1-2.dll
api-ms-win-core-memory-l1-1-3.dll
api-ms-win-core-namedpipe-l1-1-0.dll
api-ms-win-core-namedpipe-l1-2-1.dll
api-ms-win-core-normalization-l1-1-0.dll
API-MS-Win-Core-PrivateProfile-L1-1-0.dll
api-ms-win-core-privateprofile-l1-1-1.dll
api-ms-win-core-processenvironment-l1-1-0.dll
api-ms-win-core-processenvironment-l1-2-0.dll
api-ms-win-core-processsecurity-l1-1-0.dll
api-ms-win-core-processthreads-l1-1-0.dll
api-ms-win-core-processthreads-l1-1-1.dll
api-ms-win-core-processthreads-l1-1-2.dll
API-MS-Win-Core-ProcessTopology-Obsolete-L1-1-0.dll
api-ms-win-core-profile-l1-1-0.dll
api-ms-win-core-psapi-ansi-l1-1-0.dll
api-ms-win-core-psapi-l1-1-0.dll
api-ms-win-core-psapi-obsolete-l1-1-0.dll
api-ms-win-core-realtime-l1-1-0.dll
api-ms-win-core-registry-l1-1-0.dll
api-ms-win-core-registry-l2-1-0.dll
api-ms-win-core-rtlsupport-l1-1-0.dll
api-ms-win-core-shlwapi-legacy-l1-1-0.dll
api-ms-win-core-shlwapi-obsolete-l1-1-0.dll
api-ms-win-core-shutdown-l1-1-0.dll
api-ms-win-core-shutdown-l1-1-1.dll
api-ms-win-core-string-l1-1-0.dll
API-MS-Win-Core-String-L2-1-0.dll
api-ms-win-core-string-obsolete-l1-1-0.dll
api-ms-win-core-string-obsolete-l1-1-1.dll
API-MS-Win-Core-StringAnsi-L1-1-0.dll
api-ms-win-core-stringloader-l1-1-0.dll
api-ms-win-core-stringloader-l1-1-1.dll
api-ms-win-core-synch-l1-1-0.dll
api-ms-win-core-synch-l1-2-0.dll
api-ms-win-core-sysinfo-l1-1-0.dll
api-ms-win-core-sysinfo-l1-2-0.dll
api-ms-win-core-sysinfo-l1-2-1.dll
api-ms-win-core-sysinfo-l1-2-2.dll
api-ms-win-core-sysinfo-l1-2-3.dll
api-ms-win-core-threadpool-l1-2-0.dll
api-ms-win-core-threadpool-legacy-l1-1-0.dll
api-ms-win-core-threadpool-private-l1-1-0.dll
api-ms-win-core-timezone-l1-1-0.dll
api-ms-win-core-url-l1-1-0.dll
api-ms-win-core-util-l1-1-0.dll
api-ms-win-core-version-l1-1-0.dll
api-ms-win-core-winrt-error-l1-1-0.dll
api-ms-win-core-winrt-error-l1-1-1.dll
api-ms-win-core-winrt-l1-1-0.dll
api-ms-win-core-winrt-registration-l1-1-0.dll
api-ms-win-core-winrt-robuffer-l1-1-0.dll
api-ms-win-core-winrt-roparameterizediid-l1-1-0.dll
api-ms-win-core-winrt-string-l1-1-0.dll
api-ms-win-core-wow64-l1-1-0.dll
api-ms-win-core-xstate-l1-1-0.dll
api-ms-win-core-xstate-l2-1-0.dll
api-ms-win-crt-conio-l1-1-0.dll
api-ms-win-crt-convert-l1-1-0.dll
api-ms-win-crt-environment-l1-1-0.dll
api-ms-win-crt-filesystem-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-locale-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-multibyte-l1-1-0.dll
api-ms-win-crt-private-l1-1-0.dll
api-ms-win-crt-process-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-time-l1-1-0.dll
api-ms-win-crt-utility-l1-1-0.dll
API-MS-Win-devices-config-L1-1-0.dll
API-MS-Win-devices-config-L1-1-1.dll
API-MS-Win-Eventing-ClassicProvider-L1-1-0.dll
API-MS-Win-Eventing-Consumer-L1-1-0.dll
API-MS-Win-Eventing-Controller-L1-1-0.dll
API-MS-Win-Eventing-Legacy-L1-1-0.dll
API-MS-Win-Eventing-Provider-L1-1-0.dll
API-MS-Win-EventLog-Legacy-L1-1-0.dll
api-ms-win-ro-typeresolution-l1-1-0.dll
api-ms-win-security-base-l1-1-0.dll
api-ms-win-security-cpwl-l1-1-0.dll
api-ms-win-security-cryptoapi-l1-1-0.dll
api-ms-win-security-lsalookup-l2-1-0.dll
api-ms-win-security-lsalookup-l2-1-1.dll
API-MS-Win-Security-LsaPolicy-L1-1-0.dll
api-ms-win-security-provider-l1-1-0.dll
api-ms-win-security-sddl-l1-1-0.dll
api-ms-win-service-core-l1-1-0.dll
api-ms-win-service-core-l1-1-1.dll
api-ms-win-service-management-l1-1-0.dll
api-ms-win-service-management-l2-1-0.dll
api-ms-win-service-private-l1-1-0.dll
api-ms-win-service-private-l1-1-1.dll
api-ms-win-service-winsvc-l1-1-0.dll
clrcompression.dll
clrdbg.exe
clretwrc.dll
clrjit.dll
coreclr.ad7Engine.json
coreclr.dll
dbgshim.dll
dummy.deps.json
dummy.dll
dummy.pdb
dummy.runtimeconfig.json
ext-ms-win-advapi32-encryptedfile-l1-1-0.dll
ext-ms-win-ntuser-keyboard-l1-2-1.dll
hostfxr.dll
hostpolicy.dll
install.complete
libclrdbg.dll
libclrdbg.vsdconfig
Microsoft.CodeAnalysis.CSharp.dll
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.dll
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.vsdconfig
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider.dll
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider.vsdconfig
Microsoft.CodeAnalysis.dll
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler.dll
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.dll
Microsoft.CSharp.dll
Microsoft.DebugEngineHost.dll
Microsoft.DiaSymReader.dll
Microsoft.DiaSymReader.McgInterop.dll
Microsoft.DiaSymReader.PortablePdb.dll
Microsoft.MICore.dll
Microsoft.MIDebugEngine.dll
Microsoft.VisualStudio.Debugger.Engine.dll
Microsoft.VisualStudio.Debugger.Interop.10.0.dll
Microsoft.VisualStudio.Debugger.Interop.11.0.dll
Microsoft.VisualStudio.Debugger.Interop.12.0.dll
Microsoft.VisualStudio.Debugger.InteropA.dll
Microsoft.VisualStudio.Debugger.Metadata.dll
Microsoft.VisualStudio.OLE.Interop.dll
Microsoft.VisualStudio.VIL.dll
Microsoft.VisualStudio.VIL.Host.dll
Microsoft.Win32.Primitives.dll
Microsoft.Win32.Registry.dll
mscordaccore.dll
mscordbi.dll
mscorlib.dll
mscorlib.ni.dll
mscorrc.debug.dll
mscorrc.dll
msvcp140.dll
Newtonsoft.Json.dll
OpenDebugAD7.dll
OpenDebugAD7.exe
osxlaunchhelper.scpt
sos.dll
System.AppContext.dll
System.Buffers.dll
System.Collections.Concurrent.dll
System.Collections.dll
System.Collections.Immutable.dll
System.Collections.NonGeneric.dll
System.Collections.Specialized.dll
System.ComponentModel.Annotations.dll
System.ComponentModel.dll
System.ComponentModel.EventBasedAsync.dll
System.Console.dll
System.Diagnostics.Contracts.dll
System.Diagnostics.Debug.dll
System.Diagnostics.DiagnosticSource.dll
System.Diagnostics.Process.dll
System.Diagnostics.StackTrace.dll
System.Diagnostics.Tools.dll
System.Diagnostics.Tracing.dll
System.Dynamic.Runtime.dll
System.Globalization.Calendars.dll
System.Globalization.dll
System.Globalization.Extensions.dll
System.IO.Compression.dll
System.IO.Compression.ZipFile.dll
System.IO.dll
System.IO.FileSystem.dll
System.IO.FileSystem.Primitives.dll
System.IO.MemoryMappedFiles.dll
System.IO.UnmanagedMemoryStream.dll
System.Linq.dll
System.Linq.Expressions.dll
System.Net.Http.dll
System.Net.NameResolution.dll
System.Net.Primitives.dll
System.Net.Sockets.dll
System.ObjectModel.dll
System.Private.CompilerServices.ICastable.dll
System.Private.CoreLib.dll
System.Private.CoreLib.InteropServices.dll
System.Private.CoreLib.ni.dll
System.Private.Interop.dll
System.Private.Uri.dll
System.Reflection.dll
System.Reflection.Emit.dll
System.Reflection.Emit.ILGeneration.dll
System.Reflection.Extensions.dll
System.Reflection.Metadata.dll
System.Reflection.Primitives.dll
System.Reflection.TypeExtensions.dll
System.Resources.ResourceManager.dll
System.Runtime.dll
System.Runtime.Extensions.dll
System.Runtime.Handles.dll
System.Runtime.InteropServices.dll
System.Runtime.InteropServices.RuntimeInformation.dll
System.Runtime.Numerics.dll
System.Runtime.Serialization.Primitives.dll
System.Security.Claims.dll
System.Security.Cryptography.Algorithms.dll
System.Security.Cryptography.Encoding.dll
System.Security.Cryptography.Primitives.dll
System.Security.Cryptography.X509Certificates.dll
System.Security.Principal.dll
System.Security.Principal.Windows.dll
System.Text.Encoding.dll
System.Text.Encoding.Extensions.dll
System.Text.RegularExpressions.dll
System.Threading.dll
System.Threading.Overlapped.dll
System.Threading.Tasks.Dataflow.dll
System.Threading.Tasks.dll
System.Threading.Tasks.Extensions.dll
System.Threading.Tasks.Parallel.dll
System.Threading.Thread.dll
System.Threading.ThreadPool.dll
System.Threading.Timer.dll
System.Xml.ReaderWriter.dll
System.Xml.XDocument.dll
System.Xml.XmlDocument.dll
System.Xml.XmlSerializer.dll
ucrtbase.dll
vcruntime140.dll
version.txt
vsbaseservices.dll
VSDebugEng.dll
vsdebugeng.impl.dll
vsdebugeng.impl.vsdconfig
vsdebugeng.manimpl.dll
vsdebugeng.manimpl.vsdconfig
Please try the following:
OpenDebugAD7.exe --server --engineLogging --trace=response
"debugServer": "4711"
This bypasses VS Code's default launch mechanism. It will try to connect to the OpenDebugAD7.exe that you have started manually. Hopefully an error will make itself apparent.
That got me somewhere. Here's what appears to be the relevant output as seen on the console running OpenDebugAD7.exe:
>> accepted connection from client
Exception: System.AggregateException: One or more errors occurred. (Could not lo
ad file or assembly 'System.Reflection.Emit.Lightweight, Version=4.0.0.0, Cultur
e=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file spe
cified.) ---> System.IO.FileNotFoundException: Could not load file or assembly '
System.Reflection.Emit.Lightweight, Version=4.0.0.0, Culture=neutral, PublicKeyT
oken=b03f5f7f11d50a3a'. The system cannot find the file specified.
at System.Linq.Expressions.Compiler.LambdaCompiler..ctor(AnalyzedTree tree, L
ambdaExpression lambda)
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression l
ambda)
at Newtonsoft.Json.Utilities.ExpressionReflectionDelegateFactory.CreateParame
trizedConstructor(MethodBase method)
at Newtonsoft.Json.Serialization.JsonObjectContract.set_ParametrizedConstruct
or(ConstructorInfo value)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract
(Type objectType)
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type
type)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(Jso
nReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type
objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, Jso
nSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSeriali
zerSettings settings)
at OpenDebug.DispatcherProtocol.Dispatch(String req)
at OpenDebug.DispatcherProtocol.ProcessData()
at OpenDebug.DispatcherProtocol.<Start>d__24.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceled
Exceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationTo
ken cancellationToken)
at OpenDebug.Program.Dispatch(Stream inputStream, Stream outputStream)
at OpenDebug.Program.<>c__DisplayClass5_0.<RunServer>b__0()
---> (Inner Exception #0) System.IO.FileNotFoundException: Could not load file o
r assembly 'System.Reflection.Emit.Lightweight, Version=4.0.0.0, Culture=neutral
, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Reflection.Emit.Lightweight, Version=4.0.0.0, Culture=neutral
, PublicKeyToken=b03f5f7f11d50a3a'
at System.Linq.Expressions.Compiler.LambdaCompiler..ctor(AnalyzedTree tree, L
ambdaExpression lambda)
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression l
ambda)
at Newtonsoft.Json.Utilities.ExpressionReflectionDelegateFactory.CreateParame
trizedConstructor(MethodBase method)
at Newtonsoft.Json.Serialization.JsonObjectContract.set_ParametrizedConstruct
or(ConstructorInfo value)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract
(Type objectType)
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type
type)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(Jso
nReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type
objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, Jso
nSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSeriali
zerSettings settings)
at OpenDebug.DispatcherProtocol.Dispatch(String req)
at OpenDebug.DispatcherProtocol.ProcessData()
at OpenDebug.DispatcherProtocol.<Start>d__24.MoveNext()<---
>> client connection closed
I verified that System.Reflection.Emit.Lightweight.dll
is not present in the directory. I went back to %userprofile%\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug
and edited project.json to include "System.Reflection.Emit.Lightweight": "4.0.0"
in the dependencies.
After that, I ran dotnet restore && dotnet publish -o debugAdapters
. Finally, I restarted OpenDebugAD7.exe
per your instructions and was able to start a debugging session. I also verified that I was also able to hit a breakpoint in my code!
I also returned my launch.json to its original state and verified that the debugger launches properly and attaches and all that jazz. If you all would like, I can resubmit my PR #576 to include a fix for this as well.
Awesome! Please resubmit your PR and we will take a look at it.
I updated PR #576 with the dependency fix. I'm guessing that this is something that should get looked at higher up the stack since the project file doesn't explicitly reference any other System.Reflection.* packages. Maybe Microsoft.VisualStudio.OpenDebugAD7 should have included it?
Root cause was an installation of the preview 1 SDK which was causing incorrect behavior in dotnet restore
.
Environment data
dotnet --info
output:VS Code version: 1.3.1 C# Extension version: 1.2.2
Steps to reproduce
Expected behavior
The coreclr debugger installs itself
Actual behavior
Error message: Error while installing .NET Core Debugger.
coreclr-debug
outputMitigation/Possible solution
I tried working around the issue by manually editing the coreclr-debug project.json. I modified the frameworks node to look like:
After this,
dotnet restore
succeeds, but the next time I startcode
, it just replaces the contents and fails again. I then hunted down the source of that file in%USERPROFILE%\.vscode\extensions\ms-vscode.csharp-1.2.2\out\coreclr-debug\install.js
and modified the file at line 175 (DebugInstaller.prototype.createProjectJson()
):Upon restarting the vscode process, installation succeeded.