Skip to content
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

"StrictFilePathMarshaler must be used on a FilePath" error #14

Open
deadlydog opened this issue Aug 19, 2017 · 17 comments
Open

"StrictFilePathMarshaler must be used on a FilePath" error #14

deadlydog opened this issue Aug 19, 2017 · 17 comments
Labels

Comments

@deadlydog
Copy link
Owner

deadlydog commented Aug 19, 2017

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 deadlydog added the bug label Aug 19, 2017
@martinskuta
Copy link

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?

@deadlydog
Copy link
Owner Author

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.

@martinskuta
Copy link

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
Copy link

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

@deadlydog
Copy link
Owner Author

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
Copy link
Owner Author

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!

@ErikvO
Copy link

ErikvO commented Apr 26, 2019

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?

@deadlydog
Copy link
Owner Author

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!

@ErikvO
Copy link

ErikvO commented May 2, 2019

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.

@deadlydog
Copy link
Owner Author

deadlydog commented May 2, 2019

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?

@ErikvO
Copy link

ErikvO commented May 3, 2019

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.

@deadlydog
Copy link
Owner Author

deadlydog commented May 3, 2019

@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?

@ErikvO
Copy link

ErikvO commented May 3, 2019

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.

@maxisam
Copy link

maxisam commented Jun 5, 2019

I have this issue on vs2019 with GitHub for Visual Studio

@deadlydog
Copy link
Owner Author

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?

@maxisam
Copy link

maxisam commented Jun 6, 2019

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

@wiz0u
Copy link

wiz0u commented May 4, 2020

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants