Project no longer compiling after package update

dylan's Avatar


26 Jun, 2018 04:54 AM

Hi guys,

As far as I can tell the only thing that's changed here is nuget package updates - our build now fails with the error:

C:\projects\environment-manager\packages\SourceLink.Create.GitHub.2.8.3\build\SourceLink.Create.GitHub.targets(25,5): error : unable to find repository origin with: dotnet sourcelink-git origin [C:\projects\environment-manager\EnvironmentManagerWorker\EnvironmentManagerWorker.csproj

This is a package required by Octokit from github so it's needed by our project, I've tried versions 2.8.0 and 2.8.3 but neither work.

Have you seen this before?

  1. Support Staff 1 Posted by Ilya Finkelshte... on 26 Jun, 2018 05:16 AM

    Ilya Finkelshteyn's Avatar

    Does it builds locally OK with msbuild command line?

    Also can you check this issue. I am not familiar with SourceLink, but I hope that fix can be the same.

  2. 2 Posted by dylan on 27 Jun, 2018 01:31 AM

    dylan's Avatar

    I can build it in visual studio and on the command line.

    Interestingly, I had the message "Your project is not referencing the ".NETFramework,Version=v4.7.1" framework. Add a reference to ".NETFramework,Version=v4.7.1" in the "frameworks" section of your project.json, and then re-run NuGet restore." until I deleted the contents of the "obj" folder, but it builds fine after clearing that.

    I added the suggested:

        <DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.0" />

    in the two projects affected but it doesn't seem to have made any difference.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 27 Jun, 2018 02:52 AM

    Ilya Finkelshteyn's Avatar

    Is there any way to create a repro in the public repository?

    If not, we will ask you to add someone from our team as collaborator on AppVeyor. Also we will ask you to create separate project targeted to the same repository and configuration in UI (not YAML). Ensure that this project has produce the same errors.

  4. 4 Posted by dylan on 27 Jun, 2018 04:14 AM

    dylan's Avatar

    We can't make this a public repo, I'll try creating a new project now and let you know how that goes.

  5. 5 Posted by dylan on 27 Jun, 2018 04:20 AM

    dylan's Avatar

    Checked and found we don't use a .yml file - just a cmd build script:

    nuget restore .\app\MathsPathway\MathsPathway.sln
    nuget restore .\EnvironmentManager2.sln
    msbuild .\EnvironmentManager2.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
    msbuild EnvironmentManager2\EnvironmentManager2.csproj /T:Package /P:PackageLocation="%APPVEYOR_BUILD_FOLDER%\" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
    appveyor PushArtifact -Type WebDeployPackage -DeploymentName EnvironmentManager2
    7z a %APPVEYOR_BUILD_FOLDER%\EnvironmentManagerWorker\bin\Debug\*
    appveyor PushArtifact
  6. 6 Posted by dylan on 27 Jun, 2018 06:20 AM

    dylan's Avatar

    With a little more research, I've found this: - this has an associated commit adding the exact error I'm getting! - CreateTask.cs line 45

    I also found this job with the same error:

    The resolution points back to an update with appveyor in May last year, not much in the way of details though.

    I also found some other packages, Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers were superfluous and removed them. I have fewer errors but overall it didn't help.

  7. 7 Posted by dylan on 27 Jun, 2018 06:52 AM

    dylan's Avatar

    One last link, this appears to be the same issue:

    I've tried updating the version in the DotNetCliToolReference entry but it still doesn't work.

    I'll have to pick this up tomorrow, I will have to produce a version with a few auth things removed before I can give anyone access. any other troubleshooting suggestions welcome.

  8. Support Staff 8 Posted by Ilya Finkelshte... on 27 Jun, 2018 04:24 PM

    Ilya Finkelshteyn's Avatar

    This seems to be the kind of issue which is difficult to investigate without putting hands on it.

    Just to clarify: we do not ask you to make someone from our team to be a collaborator on GitHub, just on AppVeyor. Because of that we need all build configuration of test project to be set in UI.

    While you are investigating yourself, please note (is you do not know this already) that you can RDP to the build worker and repro/debug in the command line. However custom environment variables from the build session are not available in the RDP session so you might need to re-set them manually.

  9. 9 Posted by BornToBeRoot on 27 Jun, 2018 09:09 PM

    BornToBeRoot's Avatar


    i have the same issue since the last Octokit update via nuget...

    SourceLink.Create.GitHub.2.8.3 is now a dependency of Octokit.

    My repo is public, you can find it here and try to reproduce the error:
    Error is in line 124


  10. 10 Posted by dylan on 28 Jun, 2018 12:14 AM

    dylan's Avatar

    Thanks BornToBeRoot!!

    Ilya, is this enough to troubleshoot the issue?

    We could also reopen the ticket on Sourcelink's site, it isn't happening outside of appveyor though so I don't know how helpful it would be.

  11. 11 Posted by dylan on 28 Jun, 2018 05:22 AM

    dylan's Avatar

    Ok I've been working on this for a couple of hours, I seem to have gotten past the original error by passing "/P:SourceLinkCreate=false" into MSBuild, but then I have a bunch of missing packages.

    I readded Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers references, and now I just have errors saying I'm missing those.

    I've tried downgrading each of them individually to previous major version (versions I can see being added earlier in the process to a submodule) but it still complains they are missing when building the project.

    It's worth noting this continues to compile fine on my machine.

    I'd be willing to add someone as a collaborator now.

  12. Support Staff 12 Posted by Owen McDonnell on 28 Jun, 2018 06:12 PM

    Owen McDonnell's Avatar

    I've forked BornToBeRoot's project and am trying to troubleshoot there. I'm not sure yet whether it is exactly analagous to your problem.

    In case its not it is still worth making me (owenmcdonnell at a collaborator on your project.

  13. 13 Posted by dylan on 29 Jun, 2018 12:54 AM

    dylan's Avatar

    You've been added - the project is environment_manager. Thanks.

  14. Support Staff 14 Posted by Owen McDonnell on 29 Jun, 2018 04:38 AM

    Owen McDonnell's Avatar

    Thanks, but in order to see the project settings (as Ilya mentioned above, all settings should be in UI, not in yml file) can you grant me permission to update project settings as shown in the screenshot.

    But it may not be necessary...
    It looks pretty likely to me that this is a bug from octokit 0.30, and one that has been recognized as such in a fairly recent commit.
    All of your build errors happen after octokit was updated from v0.29 and your project was forced to take that dependency.

    So maybe you can roll back to v0.29 until a new release of octokit includes that commit?

    Of course, if that works you can disregard the permissions and remove me as collaborator.

  15. 15 Posted by dylan on 03 Jul, 2018 04:30 AM

    dylan's Avatar

    Hi Owen, the error is different (updating to prevent use of sourcelink fixed the original problem) but I'm still unable to compile. It's still complaining it can't find packages Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers - I'm not sure why these aren't showing up in the appveyor environment?

    I've updated your access, any help would be appreciated!

  16. Support Staff 16 Posted by Owen McDonnell on 03 Jul, 2018 05:16 AM

    Owen McDonnell's Avatar

    It looks like in previous builds the package was being installed both in the nuget restore .\app\MathsPathway\MathsPathway.sln command and also in the nuget restore .\EnvironmentManager2.sln so it was being placed in two different package folders.

    When it is installed now in the failing builds the EnvironmnetManager2.csproj is referencing it in its own packages folder.

    Without being able to see commits, I'm guessing the breaking change was in that project file.

  17. 17 Posted by dylan on 04 Jul, 2018 01:26 AM

    dylan's Avatar

    going back to where it all broke, neither the Microsoft.Net.Compilers or the Microsoft.CodeDom.Providers.DotNetCompilerPlatform packages were updated or changed at that time.

    I've rolled back the version of octokit and removed sourcelink and it hasn't helped the issue. the only differences in the environmentmanager2.csproj file I can see are minor versions on other packages - not the ones in the message. Same goes for the packages.config.

    Microsoft.CodeDom.Providers.DotNetCompilerPlatform was updated in the previous push but that built fine. I've already tried rolling it back and it didn't help.

    I'm not 100% sure what you mean by, "EnvironmnetManager2.csproj is referencing it in its own packages folder." as far as I can see it's referenced in the same way it has always been referenced?

  18. Support Staff 18 Posted by Owen McDonnell on 04 Jul, 2018 03:42 AM

    Owen McDonnell's Avatar

    I made the discussion private since i'm sharing some screenshots from your build log.

    I think the package reference error is unrelated to sourcelink issue, so i think we can put that aside.

    Let me explain more explicitly what i mean...

    When i go to your last successful build and search "Microsoft.codedom" i get many references. The package is not only installed by the nuget restore .\app\MathsPathway\MathsPathway.sln but also by the nuget restore .\EnvironmentManager2.sln command.You can see this in the first screenshot.

    When i go to any recent failing build and search "Microsoft.codedom" i get only references to it under the nuget restore .\app\MathsPathway\MathsPathway.sln command. You can see this in the second screenshot.

  19. 19 Posted by dylan on 05 Jul, 2018 12:27 AM

    dylan's Avatar

    Ok I've finally fixed it.

    The key was removing the nuget restore for the environment manager solution and adding a separate one for each project's packages.config file.

    I'm not sure if this is a nuget bug or expected behaviour and I'm not sure why this changed (as I said, the problem packaged hadn't been updated) but that was the solution.

    I'd encourage you to make this discussion public again, I didn't find the solution on google so this might help someone else. The screenshots don't contain anything I'd consider secret.

    updated restore statements look like:

    nuget restore .\ProjectFolder\packages.config -SolutionDirectory .\
    nuget restore .\ProjectFolder2\packages.config -SolutionDirectory .</code>
  20. Support Staff 20 Posted by Owen McDonnell on 05 Jul, 2018 12:58 AM

    Owen McDonnell's Avatar

    I made it public again.

    So if you go to the EnvironmentManager2.csproj file in your repository and check the history you don't find any commits of relevance to this case? Like, for example, the removal of a PackageReference element?

  21. 21 Posted by dylan on 05 Jul, 2018 01:11 AM

    dylan's Avatar

    No, I can see the commit that the problem originated in and the package reference element for that project didn't change at all. The only thing that was included were minor version updates to other packages.

    My working theory is that package is only referenced in one project and the solution restore stopped reading all the package.config files - it seemed to restore all the common packages but not the ones that were unique to the second project.

    I have no real lead on what would cause this. There were no updates to the .sln file at the same time.

  22. 22 Posted by dylan on 05 Jul, 2018 01:19 AM

    dylan's Avatar

    Ok this is interesting - it's listed in packages.config, and this is at the top of the csproj file:

    <Import Project="..\packages\Microsoft.Net.Compilers.2.8.2\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.8.2\build\Microsoft.Net.Compilers.props')" />

    but I don't have a <Reference /> entry in the csproj file.

    This didn't change but maybe it needs a reference entry? I've removed and re-added the package however, nuget manager never creates this.

  23. Support Staff 23 Posted by Owen McDonnell on 05 Jul, 2018 03:53 PM

    Owen McDonnell's Avatar

    Is this a netcore project or .net framework?

  24. 24 Posted by dylan on 05 Jul, 2018 11:55 PM

    dylan's Avatar

    .net framework

  25. Support Staff 25 Posted by Owen McDonnell on 06 Jul, 2018 02:42 AM

    Owen McDonnell's Avatar

    From this documentation...

    .NET full framework projects support PackageReference, but currently default to packages.config. To use PackageReference, migrate the dependencies from packages.config into your project file, then remove packages.config

    But that doesn't explain how your project got broken in the first place.
    Perhaps a change in nuget? The last update on our platform was in may

  26. 26 Posted by dylan on 09 Jul, 2018 03:44 AM

    dylan's Avatar

    That's interesting, I hadn't tried using PackageReference so I don't know much about it.

    It broke with minor updates to a few packages. I'm really not sure what changed but it's working currently. I'll look into PackageReference and see if it's likely to simplify things but for the moment I'll leave what I have.

    Thanks for the assistance.

  27. Support Staff 27 Posted by Owen McDonnell on 09 Jul, 2018 04:31 AM

    Owen McDonnell's Avatar

    No problem.
    Don't forget to remove me from your team.

  28. Ilya Finkelshteyn closed this discussion on 08 Sep, 2018 09:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac