GitTools / GitLink

Making .NET open source accessible!
MIT License
555 stars 86 forks source link

Problem with authentication on a private bitbucket repository #101

Open rvdginste opened 7 years ago

rvdginste commented 7 years ago

I tried to use gitlink on Visual Studio 2013 with ReSharper 2016.2, and I am not very successful. :( I have a (private) service X that consists of 3 projects: X.host, X.server and X.api. Each project has its own solution and its own git repo. X.server and X.api are normally published as nuget packages on a private nuget package repo, and I normally put the pdb files also in the nuget packages.

So, to test gitlink I built X.server and X.api and used the tool through commandline on those pdb files. Then I used those dlls and pdbs to build and deploy X.host. This is a windows nt service, so to debug this, I run visual studio as an administrator, open the X.host solution and attach to the service process.

I configured ReSharper (tools, external sources) to "navigation to sources", so that it would use symbol files. When i open the X.host code, and follow (go to declaration) class that are from X.server and X.api, ReSharper runs its decompiler on that code, which I think is strange: at that point I'm connected to a running process, it should find the real source, but I suppose this is a ReSharper issue. As soon as I put a breakpoint in the decompiled code, it seems that ReSharper (or Visual Studio?) tries to fetch the source. At that point I get a html file that asks me to login on Bitbucket.

I did follow the README that says to login into Bitbucket from Internet Explorer, but that does not seem to work. I tried the following:

Any ideas on what I am doing wrong, or is it currently a problem to use this with private git repositories?

GeertvanHorrik commented 7 years ago

Private git repositories are a problem. See #37, a proxy would be needed (but note that this would expose your code because the proxy will do the authentication and thus removes the need for client authentication).

You can look into #37 for a detailed discussion on this.

I think that R# doesn't support updated pdb files (though I am not 100 % sure), so when using R#, it will actually decompile and not use the source files on the internet as specified in the pdb.

rvdginste commented 7 years ago

Thanks for the speedy reply. It's a bit of a bummer though. Up until now I've always published the pdb files together with the dlls in the nuget packages, but that doesn't give access to the correct (version of the) source. Then I wanted to try nuget symbol packages with the myget symbol server and did not manage to get that to work. I had read about gitlink before and always meant to try it and thought it might be more straightforward, but this is blocking for me.

Anyways, a simple authenticating proxy as in #37 or a more advanced proxy like the one that @shonnly made (see #66) might be an option. Personally, I would be fine with running a local proxy for the latter.

Either way, I think it would be best to change the section "Source Stepping returns HTML" from the README: it gave me the impression it is supposed to work.

GeertvanHorrik commented 7 years ago

Thanks for the feedback. Interested in doing a PR on the readme?