Closed HristoHentov closed 6 years ago
Update: Before I Begin here is some meta info about my enviroment.
VisualStudio: 2017, version: 15.6.2 Targeting: .NET Standard 2.0 Remote repo host: Bitbucket (company domain)
Okay so I tired a clean setup with a test repo hosted behind our company bitbucket domain and a simple console app as a client and still failed.
I'll go over exactly what I do, and where it gets me going on :
Running dotnet build /p:SourceLinkCreate=true /v:n
on my project results in
"unable to find repository origin with: dotnet sourcelink-git origin".
NOTE: Running with SouceLink.Create.CommandLine results in: "unable to convert OriginURL: https://my.username@bitbucket.company.com/scm/mk/sourcelinktest.git""
Adding <SourceLinkUrl>https://bitbucket.company.com/projects/mk/repos/sourcelinktest/raw/*?at={commit}</SourceLinkUrl>
to the csproj and running the same command results in:
exit code 1 when running: dotnet sourcelink-git create -u "https://bitbucket.company.com/projects/mk/repos/sourcelinktest/raw/*?at={commit}" -f "obj\Debug\netstandard2.0\sourcelink.json" --notingit "embed" --hashmismatch "embed"
I forked SourceLink and ran the dotnet sourcelink-git with the same command args. I first got an error about not being able to find the file at obj\Debug\netstandard2.0\sourcelink.json (which I fixed by creating the folders) I got a json that had the following mapping:
{"documents":{"C:\\Projects\\SourceLinkFork\\SourceLink\\*":"https://bitbucket.company.com/projects/mk/repos/sourcelinktest/raw/src/*?at=e7849dc03517032cb6e82b39c81a16141a308b64"}}
Issue was resolved by making sure we add
<ItemGroup>
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.0" />
</ItemGroup>
To the .csproj file for the nuget we wanted to build. Apparently, SourceLink.Create.CommandLine
uses commands from dotnet-sourcelink that require the CLI tool
Apparently, SourceLink.Create.CommandLine uses commands from dotnet-sourcelink that require the CLI tool
Not it does not. But SourceLink.Create.BitBucketServer
uses dotnet-sourcelink-git
as documented at:
https://github.com/ctaggart/SourceLink/wiki#dotnet-sourcelink-git
I am to trying to get sourcelink to work with bitbucket server, however when I try to build my project with dotnet build /p:SourceLinkCreate=true /v:n.
The setup is as follows. My code resides on https://bitbucket.mycompany.com/projects/AA/repos/my.repo.full.name
I have added the SourceLink.Create.BitBucket.Server and have edited the .csproj to contain the following inforamtion:
The error I recieve is :
C:\Users\hristo.h\.nuget\packages\sourcelink.create.bitbucketserver\2.8.0\build\SourceLink.Create.BitBucketServer.targets(25,5): error : exit code 1 when running: dotnet sourcelink-git create -u "https://bitbucket.mycompany.com/projects/AA/repos/my.repo.full.name" -f "obj\Debug\netstandard2.0\sourcelink.json" --notingit "embed" --hashmismatch "embed" [C:\Projects\TheRepoProject\my.repo.full.name\src\Folder.Some.Other.Folder\Namespace.Name.csproj]
Is there something else that needs to be added? I saw some previous issue that involved adding a placeholder for the commit in the url, but not sure how this is supposed to work