question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET Native tool chain build issues

See original GitHub issue

When a UWP console application using Terminal.Gui is built via .NET Native tool chain it does not respond to input. Both keyboard and mouse input won’t work. The rendering works fine though. If I run the same build with .NET Native tool chain disabled everything behaves as expected.

Is there anything in Terminal.Gui that could violate these guidelines?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:22 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
InvictusMBcommented, Jun 20, 2020

[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] did not work either.

1reaction
InvictusMBcommented, Jun 20, 2020

They do use the same library. The difference is that in Release mode .NET Native tool chain generates wrappers for P/Invoke marshaling. And in case of ReadConsoleInput with InputRecord [] it fails for whichever reason. You can see the warning about that in VS Error list window.

I’ve tried defining marshaling explicitly but it wouldn’t work either:

[DllImport ("kernel32.dll", EntryPoint = "ReadConsoleInputW", CharSet = CharSet.Unicode)]
public static extern bool ReadConsoleInput (
  IntPtr hConsoleInput,
  [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] // <---- this didn't help
  [Out] InputRecord[] lpBuffer,
  uint nLength,
  out uint lpNumberOfEventsRead);

Might be a bug in .NET Native tool chain itself but I’m too far down the rabbit hole already.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UWP project build with "Compile with .NET Native tool ...
Attempting to run the build in Release mode when "Compile with .NET Native tool chain" is enabled causes the ilc.exe process to go...
Read more >
[UWP] Compile with "Compile with .NET Native tool chain" ...
During uploading process, we encountered "Supported API test" is failed in WACK (Windows Application Certification Kit) tool. So as per ...
Read more >
Can I run the net native tool chain after a compilation?
Our .net native tool chain recently became very flaky (compiling it once fails on a machine, clean building it on the same machine...
Read more >
VS2019 .NET Native Toolchain fails to build as of 16.0.4
In a UWP app, I build in Release mode targeting x64. This worked perfectly until the 16.0.4 update of Visual Studio 2019, ...
Read more >
[Regression] UWP project fails to build under .Net Native tool ...
[Regression] UWP project fails to build under .Net Native tool chain in Visual Studio · 1. Download attached project file · 2. Change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found