8000 FilePathMarshaler must be used on a FilePath · Issue #241 · libgit2/libgit2sharp · GitHub
[go: up one dir, main page]

Skip to content
FilePathMarshaler must be used on a FilePath #241
Closed
@SimonCropp

Description

@SimonCropp

I am getting an exception "FilePathMarshaler must be used on a FilePath"

Which is coming from here

    public override IntPtr MarshalManagedToNative(object managedObj)
    {
        if (managedObj == null)
        {
            return IntPtr.Zero;
        }

        if (!(managedObj is FilePath))
        {
            throw new MarshalDirectiveException("FilePathMarshaler must be used on a FilePath.");
        }

        return StringToNative(((FilePath)managedObj).Posix);
    }

The interesting thing is if i set a breakpoint in that method and use the immediate window I can do the following

managedObj is FilePath is true

managedObj.GetType().FullName is "LibGit2Sharp.Core.FilePath"

So I have no idea why it is throwing an exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0