Problem building .NET Framework 4.8 project with .NET Standard 2.0 reference in Atlassian Bamboo

JohnyG 20 Reputation points
2024-03-29T15:03:38.91+00:00

(apologise if this is the wrong forum, first time posting)

 

Hello,

We use Atlassian Bamboo for our CI/CD needs and I'm having trouble with one solution.

 

There is a .NET Framework 4.8 project with a reference to another project that is .NET Standard 2.0

On my local machine if I msbuild the solution, everything works fine.

If I do try to do the same in pipeline, I get these errors:

 

image

 

Steps that are being done in Bamboo:

 

  1. Clean working directory
  2. Source code checkout
  3. nuget restore solution
  4. msbuild v17.0 solution with properties "/p:BuildProjectReferences=true /p:Configuration=Release /p:WarningLevel=0"

 

I also checked nuget and msbuild versions that are being used and they are:

NuGet Version: 6.0.0.280

MSBuild version 17.9.5+33de0b227 for .NET Framework

 

How do I make this pipeline work?

 

Thank you.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,377 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 48,281 Reputation points
    2024-03-29T15:13:51.1633333+00:00

    I believe this may just be an issue with your build server. Normally when you restore packages from NuGet it caches the package on the machine so it doesn't ever have to do it again. This is done independent of any solutions or projects you build. Hence cleaning the solution/projects directory doesn't touch the Nuget package cache.

    On the build server, go to the %user%\.nuget\packages folder for whatever user account your build is running under. Find the package that is causing the problem and delete the folder. Then try running your build again. It should download a new copy of the package. Alternatively you can just run nuget install microsoft.extensions.logging.abstractions -version 7.0.1 to pull down the package into the cache.

    My assumption here is that you're just using the public nuget.org source and not your own private feed. However I'm also assuming you don't have any customizations like nuget source mapping or whatnot contained in a nuget.config related to your project.

    If that still doesn't work then I'm going to start wondering about a consolidation issue in your solution such that multiple projects are referencing different versions of the package. But that doesn't seem to line up with the error you're getting here.


0 additional answers

Sort by: Most helpful