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.

Custom marshaling fail on .NET Core makes libgit2sharp 0.25.2 fail

See original GitHub issue

When upgrading nerdbank.gitversioning from my private libgit2sharp build of 0.24.7-g9fca61fdda to the official 0.25.2, which by the way added custom marshalers back into the codebase that I had originally removed for .NET Core 1.x support, we’re seeing frequent failures because .NET Core claims that the FilePath type isn’t seem as itself in the custom marshaler method.

My recommendation for a workaround is to switch back to my original .NET Core supporting solution for this project, which avoids custom marshalers altogether.

Other issues tracking the failure:

https://github.com/dotnet/coreclr/issues/19654 https://github.com/AArnott/Nerdbank.GitVersioning/issues/215

Version of LibGit2Sharp (release number or SHA1)

v0.25.2

Operating system(s) tested; .NET runtime tested

Windows, Ubuntu 18 .NET Framework and .NET Core

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ethomsoncommented, Aug 24, 2018

My recommendation for a workaround is to switch back to my original .NET Core supporting solution for this project, which avoids custom marshalers altogether.

I think you’re talking about the changes that occurred in this nontrivial pull request? You can imagine that I’m not exactly jumping up and down at the thought of reverting this.

I’d like to hear what the .NET team has to say about this and possible workarounds before we start thinking about adding 500 lines of code back to the project that we removed nine months ago.

0reactions
AArnottcommented, Aug 26, 2018

Well, that and AArnott/Nerdbank.GitVersioning#217. The original fix for AArnott/Nerdbank.GitVersioning#215 was ineffective.

Read more comments on GitHub >

github_iconTop Results From Across the Web

P/Invoke custom marshaler sometimes fails type cast #10965
I'm trying to track down why my upgrade of libgit2sharp to 0.25.2 led to nerdbank.gitversioning to fail (reliably) on a seemingly random set...
Read more >
The type initializer for 'LibGit2Sharp.Core.NativeMethods' ...
The failing one has a “packages.config”, while the working one does not. Working project has NO reference to NativeMethods in the csproj file, ......
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