6

Project Setup : Mixed framework solution

  1. .Net Framework 4.6.2 projects in solution : 15
  2. .Net Standard 2.0 projects in solution - 1

Development Machine

  1. Visual Studio 2017(15.7.4) : Builds without any errors

Build Server

  1. TeamCity Version 2017.1.3
  2. Build Steps
    • Nuget Restore(3.4.4)
    • dotnet Restore
    • MSBuild( Build Tools 2017), Tools Version 15.0

Build fails with following error in the .net standard 2.0 project : [ResolvePackageAssets] C:\Program Files\dotnet\sdk\2.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198, 5): Package System.Security.Cryptography.ProtectedData, version 4.4.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.

What's interesting is I can't find reference or use of System.Security.Cryptography.ProtectedData anywhere in the project. Any help is greatly appreciated.

P.S - Can't use dotnet build, as the solution needs building of licenses.licx files, and the component which builds it (Microsoft.Build.Tasks.LC) is not ported to .Net Core. The suggestion from various posts was to use MsBuild.exe

  • I assume that package is pulled in by the SDK. Can you get a build log from the msbuild.exe command on the server? That might shed some light to why the package is believed to be missing. – Alex Ghiondea - MSFT Jul 12 '18 at 23:28
  • I have similar error with MSBuild Tools 2019 or 2022 and TeamCity 2022.04, with the simple NET Standard Project and not found 'System' library. – Ejrr1085 May 29 '22 at 17:45
  • TeamCity is the problem, because when I use MSBuild comand: msbuild helloworld.csproj /t:Build /verbosity:detailed in CMD Developer Command Prompt for VS is succesfull. – Ejrr1085 May 29 '22 at 17:46

0 Answers0