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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

MS Build unable to build Unit Test Project using Bamboo

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

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
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

595 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you