VS.DiffAllFiles icon indicating copy to clipboard operation
VS.DiffAllFiles copied to clipboard

"StrictFilePathMarshaler must be used on a FilePath" error

Open deadlydog opened this issue 8 years ago • 17 comments
trafficstars

The following error was reported on the VS Marketplace:

Trying to use this. When I select a changed file and click Unstaged (or All Files), I get: Unexpected Error Occurred: StrictFilePathMarshaler must be used on a FilePath. V15.2(26430.16) Release. Diff All Files v1.0.1 By dale 8/8/2017

I've experienced this problem in the VS 2015 version of the Diff All Files, but not the VS 2017 version, so it will still need to be investigated. In VS 2015 this error was thrown from the gitlib2sharp library, and the workaround was to re-clone the repository (to a different directory, or delete your current directory and re-clone). I'm not sure if that workaround will work in VS 2017 or not though, so if we could get confirmation on that it would be nice.

We still need to see if there's some way we can have Diff All Files handle this error more gracefully, and ideally have additional logic in code to get it working without the user having to re-clone the Git repository.

deadlydog avatar Aug 19 '17 00:08 deadlydog

I am encountering the same error in VS 2017 (15.3).

image

I tried to re-clone the repo as I read in your first comment, but it is still same error. Is there something else I could try?

martinskuta avatar Aug 30 '17 13:08 martinskuta

Hi @martinskuta, are you still able to reproduce the error? If so, can you give this updated version 1.0.1.1 of Diff All Files a try and see if it resolves the issue. All I've done here is updated to use the latest version of LibGit2Sharp, and the release notes did mention some bug fixes around file paths in the library, so I'm hoping it solves the issue. Let me know, thanks.

VS.DiffAllFiles.VS2017-v1.0.1.1.zip

Oh, and you'll need to rename the file extension from .zip to .vsix in order to install it; GitHub wouldn't allow me to upload it with the .vsix extension.

deadlydog avatar Sep 12 '17 06:09 deadlydog

Hi,

I tried the attached version, it seems to solve the issue, but I get different error now: image It happens if I try with All files, staged, unstaged, combined or not. This unexpected error happens for every file (the notification popup there is given) Any idea?

martinskuta avatar Sep 12 '17 07:09 martinskuta

Ah, now I noticed you have created #15 for it :)

martinskuta avatar Sep 12 '17 07:09 martinskuta

Thanks for the confirmation @martinskuta. I'm glad LibGit2Sharp was able to get at least one of their problems resolved. I tried looking into the key not present in the dictionary error last night without much success. This is where the error is thrown from. I'm going to keep it on my mind though in hopes of having a eureka moment of how to get around it. If you have any suggestions, I'm all ears. Thanks.

deadlydog avatar Sep 12 '17 14:09 deadlydog

I just updated the VS 2017 extension to v1.0.2 which includes the latest version of LibGit2Sharp (v0.26). I had a git repo where I could reliably reproduce the "The given key was not present in the dictionary." error, and it looks to have fixed it. I'm not certain if it also fixes the "StrictFilePathMarshaler must be used on a FilePath" error however as I do not have a git repo where I can reliably reproduce it anymore. If you guys do, I'd appreciate you testing it out and letting me know if it seems to be fixed with the new version or not. Thanks!

deadlydog avatar Apr 01 '19 06:04 deadlydog

We just started using git and VS2019. I now get the "StrictFilePathMarshaler must be used on a FilePath" error in VS2019: image Could there be a regression?

ErikvO avatar Apr 26 '19 13:04 ErikvO

Thanks @ErikvO , it seems this error is unrelated to the "key not present in dictionary error" I guess. Would you be willing to zip up and send me your repository so that I can reproduce this issue and try and debug it? If so, send it to my email address deadlydog AT hotmail.com. Thanks!

deadlydog avatar Apr 27 '19 03:04 deadlydog

Unfortunately I cannot share the repository. I have however found out what the issue was for me: I also had the GitHub extension installed. This extension also has a dependency on libgit2sharp. This reported issue on the libgit2sharp repository pointed me into the right direction. I assume the versions of libgit2sharp used by GitHub and DiffAllFiles are different, causing this issue.

ErikvO avatar May 02 '19 13:05 ErikvO

Thanks @ErikvO . I've found that same reported issue in the past, and is actually what lead me down the road of self-signing the libgit2sharp.dll that gets included with DiffAllFiles to prevent Visual Studio from mixing up the same dll from the 2 different sources/versions. I've had the GitHub for Visual Studio extension installed in VS 2017 for years and now also have it in 2019, and since implementing the self-signing of the dll have not experienced this issue.

You're saying that you removed the GitHub for Visual Studio extension and the problem went away?

deadlydog avatar May 02 '19 22:05 deadlydog

Yes, I indeed removed the GitHub for Visual Studio extension. That resolved the issue. For now this is acceptable, as I don’t need it for my job. I just installed it so I could also work on my hobby projects at work.

ErikvO avatar May 03 '19 05:05 ErikvO

@ErikvO I'm also curious if you saw that error on ALL of your git repos when you had the GitHub for Visual Studio extension installed? or only in some of them?

deadlydog avatar May 03 '19 05:05 deadlydog

I saw the error in all of them. We use multiple repositories and they all had it. I've removed a local repository and recloned it in another location. The issue also happened in this new repository.

ErikvO avatar May 03 '19 06:05 ErikvO

I have this issue on vs2019 with GitHub for Visual Studio

maxisam avatar Jun 05 '19 22:06 maxisam

I have this issue on vs2019 with GitHub for Visual Studio

@maxisam I'm not entirely surprised, as my extension and that one are both using the LibGit2Sharp library which is where this error is originating from.

I'm curious, are you getting that error in GitHub for Visual Studio even without having Diff All Files installed? Or do you have them both installed?

deadlydog avatar Jun 05 '19 22:06 deadlydog

it was fine with GitHub for Visual Studio until I installed Diff All Files

maxisam avatar Jun 06 '19 04:06 maxisam

I have this issue on vs2019 with GitHub for Visual Studio

I have this issue on vs2019 without GitHub for Visual Studio

I just made my first 'publish' of my project using VS2019 'Publish to Github' provider, and Diff All Files give me the same error as OP

(I don't have the problem with other projects that are using a normal git repository - non github)

wiz0u avatar May 04 '20 23:05 wiz0u