dotnet / dotnet/vscode-csharp

Calling into Native Code is not supported in the context

Open
#5,441 6 comments 0 reactions 0 assignees View on GitHub
Debugger OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

## Description
Sort of related to a few other issues I have created, this one deals with native code being called while debugging in general. I am using a debuggertypeproxy for the debug views. The proxies call into native code. In the example I show below, I have a few public properties defined on the proxy which show in the debug view. Those properties ultimately call native code and the evaluation fails.

I have blacked out a lot of the picture due to sensitive information. This is a general inquiry and bug report as this is not the only instance I have seen this behavior in. Whenever a debugged object seems to call into native code, evaluation fails.

## Environment data
dotnet / vscode latest
omnisharp 1.25.1

## OmniSharp log

## Steps to reproduce
One thing to note is that I have I am not using DLLImport for the native method calls. I am using the NativeLibrary API to create function pointers to the native methods in the form: delegate* NativeFunc. The function pointers are then executed as such: z = NativeFunc(x, y). I am not 100% sure, but fairly certain evaluation still fails with DllImport instead. Regardless, I need to use the function pointer mechanism for the native interaction, because I need to reload those pointers multiple times during runtime.

## Expected behavior
Evaluation works

## Actual behavior
Evaluation fails

## Additional context
![dbg](https://user-images.githubusercontent.com/62843610/200646168-4ea29953-0d78-4629-881c-5691401d88c0.jpg)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.