-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilePathMarshaler must be used on a FilePath #241
Comments
Can you post the full LibGit2Sharp stack trace? |
Exception: |
@SimonCropp Would you also agree to share the content of the |
H:\Fody.git |
I tried to reproduce the issue. But, so far, I haven't been able to do so and will need a little help from you.
Below is what I have tested. Can you check that this is passing as well in your environment? Clone Fody into a bare local repository:
Create a subst drive pointing to the clone location:
Following test pass: [Fact]
public void CanOpenBareRepoOnSubstDrive()
{
using (var repo = new Repository(@"H:\Fody.git"))
{
Assert.NotNull(repo);
}
} Create a network share pointing to the clone location:
Following test pass: [Fact]
public void CanOpenBareRepoFromAnUncPath()
{
using (var repo = new Repository(@"\\localhost\TempFody\Fody.git"))
{
Assert.NotNull(repo);
}
} Then, using Windows 7 GUI, I mapped Following test pass: [Fact]
public void CanOpenBareRepoFromAMappedNetWorkDrive()
{
using (var repo = new Repository(@"J:\Fody.git"))
{
Assert.NotNull(repo);
}
} |
hold of on this one for a while. I will put the effort into creating a proper repro. |
Could add the type of managedObj to the exception message to maybe make it easier to debug? |
After much tinkering this is my bug. Turns out I had two copies of the libgit2sharp dll loaded. hence the type comparison was failing. Sorry for the hassle and thanks for the support. |
I'm fuzzy on how .NET is expected to behave when similar unsigned assemblies are referenced in the same domain, but @shiftkey's issue/resolution suggests this might be something we need to have an answer for. One would expect more "competing" Git-related VS extensions to appear over time... /cc @martinwoodward @xpaulbettsx |
Urgh. I'm going to summon @phkelley and @jamill on this one as well. My personal knowledge gets very fuzzy in this area especially when we start talking about how the git2.dll loading is managed. Just to be clear, the scenario we are concerned about is:
Are we going to have dll loading issues? |
Git4VS is running v0.10 of libgit2sharp. SaveAllTheTime is running v0.11. Oh, and testing SaveAllTheTime in the Experimental VS Instance didn't help identify the issue because the Git4VS extension wasn't loaded. Good times. |
@martinwoodward Yes, that's the scenario I just encountered. |
Thanks @shiftkey. Guess this is more than just hypothesis then - urgh :-( FWIW, we might end up creating a parallel MS Connect bug but for now let's carry on here as it also has general interest as evidenced by this particular issue which didn't involve the VS Tools for Git (I think) and VS Extensions. |
I might have a solution that would fix this. The way we upgrade LibGit2Sharp with the latest libgit2 binaries relies on the UpdateLibgit2ToSha.ps1 script. Among other things, this takes care of building libgit2 and moving the generated dlls in the correct tree structure. The idea would be to update this script and make it rename the generated .dll/.pdb files to make them unique, naming them after the corresponding libgit2 commit sha. Thus, instead of making LibGit2Sharp probe for a generic Provided the solution works and actually makes sense, this would allow different future versions of LibGit2Sharp to run side by side. I discussed this subject with @ben and he's going to draft something along those lines. Hopefully, we'll release a How do you feel about this? |
/cc @spraints @KindDragon |
Yep, I'm now hitting this bug in SaveAllTheTime with anyone who has the Git Tools for VS installed, which ships lg2s too :-/ |
This is actually pretty problematic - even if I downgrade SaveAllTheTime's libgit2sharp to 0.10, I'm hitting this crash. |
Closed by 48ea4d5 |
I am getting an exception "FilePathMarshaler must be used on a FilePath"
Which is coming from here
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 truemanagedObj.GetType().FullName
is "LibGit2Sharp.Core.FilePath"So I have no idea why it is throwing an exception.
The text was updated successfully, but these errors were encountered: