Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

MS Build unable to build Unit Test Project using Bamboo

Narasimham Addepalli November 9, 2017

I have a  .NET 4.6.1 solution that has a Class Library and a Unit Test project. I setup my build plan in Bamboo to do a Continuous Integration build. The build task fails with the below error.

The type 'System.Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 

I tried building this locally using Visual Studio and it builds just fine. I also tried building using MS Build on my developer laptop from the command line and it builds without any errors.

I removed the Unit Testing project from my solution and I got a successful build.

There is also a warning in one of the previous steps about .NET Framework 4.6.1. I believe this has nothing to do with the previous error, but I wanted to put everything out there just in case.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [D:\data\bamboo-agent-home\xml-data\build-dir\AIS-CTB-JOB1\Emc.Cryptography\Emc.Cryptography.csproj]

1 answer

0 votes
Remi Sarraillon January 10, 2020

Hi there,

I've actually same concern and I found this, it might be help ;)

The feature request for Windows/.NET builds is here: https://bitbucket.org/site/master/issues/13452/support-for-native-windows-net-builds-on 

Follow that ticket for updates from Atlassian team.

Meanwhile, you can include assemblies directly with the nuget related.

https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies.net461/

Same problem for me is now resolved.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events