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

Microsoft.Build.Tasks.Git.targets(20,5): error : Unable to locate repository containing directory #211

Closed
sonerguven opened this issue Feb 12, 2019 · 9 comments

Comments

@sonerguven
Copy link

Hi,

While building the project, an error below occurs. I know it's not related to BaGet but any idea how to solve?

Thanks.

D:\Users\qqqq.nuget\packages\microsoft.build.tasks.git\1.0.0-beta-63127-02\build\Microsoft.Build.Tasks.Git.targets(20,5): error : Unable to locate repository containing directory 'd:\Users\qqqq\Desktop\BaGetSource\src\BaGet.Protocol'. [d:\Users\qqqq\Desktop\BaGetSource\src\BaGet.Protocol\BaGet.Protocol.csproj]

@loic-sharma
Copy link
Owner

loic-sharma commented Feb 12, 2019

What .NET Core SDK are you on? I found this similar issue, the fix was to install a newer version of the .NET Core SDK. BaGet requires v2.2+

@sonerguven
Copy link
Author

I tried this on couple of computers that have different OS. They all have .net core 2.2+. By the way I can run pre-compiled BaGet project by executing dotnet BaGet.dll but the problem is that I can't build the source code.

@sonerguven
Copy link
Author

In addition, I faced one more error on OS X Mojave. While building nuget packages, the NerdBank.GitVersioning task failed unexpectedly. I'm not sure if this is related to the locating repository problem.
screen shot 2019-02-13 at 09 17 18

@loic-sharma
Copy link
Owner

loic-sharma commented Feb 13, 2019

Jeez you’re hitting the strangest problems! 😄

It seems like the second problem is separate from the first. Can you reproduce the first problem with just dotnet build on Windows? If so, could you run on the Developer Command Prompt msbuild.exe .\BaGet.csproj /t:build /bl and then send me the *.binlog file that is generated?

For the second problem I’ll try updating my Mac to Mojave and I’ll see if the problem reproduces for me. For now, you can get around this by removing the Nerdbank.GitVersioning PackageReference from this file: https://github.com/loic-sharma/BaGet/blob/master/src/Directory.Build.props

Sorry about all these issues!

@sonerguven
Copy link
Author

Murphy has always been with me and will soon cause me lose my desire to work as a software developer 😃
Here is msbuild.binlog in zip file.
msbuild.zip

For the second problem, I removed the reference. This solved the problem but now I have another one. I think this problem is related to first one.

image 13 02 2019 at 10 57

@loic-sharma
Copy link
Owner

How are you getting the source code that you build? I was able to reproduce this error when building the source code from the latest GitHub release. If this is indeed the problem, you can get around this by using git to get the latest release's source code:

git clone https://github.com/loic-sharma/BaGet.git
git checkout v0.1.54-prerelease

@sonerguven
Copy link
Author

I solved the problem by removing Nerdbank.GitVersioning and Microsoft.Build.Tasks.Git fromDirectory.Build.props.
Thanks.

@loic-sharma
Copy link
Owner

loic-sharma commented Feb 20, 2019

I’ll move away from NerdBank.GitVersioning in the future and rewrite the versioning generation using Azure Pipelines. Hopefully you won’t have to do this hack for long.

@Sewer56
Copy link

Sewer56 commented Aug 12, 2019

cmd_TFHkIyjqtq

I can personally reproduce this on Windows.
Installed I have both .NET Core 2.2 and even 3.0 Preview.

The workaround for me has been the same, remove Nerdbank.GitVersioning and Microsoft.SourceLink.GitHub for the time being, however it's not optimal :/

loic-sharma added a commit that referenced this issue Sep 15, 2019
This replaces `Nerdbank.GitVersioning` with Azure DevOps queue-time variables for versioning. This is a simpler model that should avoid issues like #211 and #135.

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

No branches or pull requests

3 participants