Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Does Bitbucket Pipelines support building .NET applications?

This question is in reference to Atlassian Documentation: Bitbucket Pipelines (beta)

I'm wondering is pipelines support to build .net framework? I didn't see .yml config for .net. Please advise.

 

Regards

John Wu

14 answers

1 accepted

3 votes
Answer accepted

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 our team.

Hello I would like to ask the same question. Will there be in near future any solution to this? We need to build applications with .net 4.7.1 in pipelines and due to missing TPT inheritance in Entity Framework core we cannot use .netCore images. Thank You for reply

Windows has an 80% desktop market share as of 2019 and people are still creating and maintaining desktop applications for it in .NET Framework and C++.  Offering a windows build platform on pipelines would be in Atlassian's benefit.

If you don't mind using mono, you can as well do:

image: mono

pipelines:
  default:
    - step:
        script:
          - nuget restore
          - MONO_IOMAP=case xbuild /t:Build /p:Configuration="Release" /p:Platform="Any CPU" Solution.sln

I have tried with this script but I am not able to run the build. I am getting the error near nuget restore. command not found. Please help me

You can use msbuild instead deprecated xbuild

msbuild /t:Clean,Build /p:Configuration=Release 'Solution.sln'
Like # people like this

Hi John,

One of our customers provided an example of a Bitbucket Pipelines configuration for a .NET Core application. You can find it on Bitbucket.

We do not yet support running pipelines in Windows environment but we're keeping an eye on the work that Docker and Microsoft are doing together.

Thanks,

Sten

Hi,

Here's my "best effort" for testing .Net projects in Pipelines.

So, we know that there is no msbuild support at the moment.

And porting to .Net Core is not a good solution.

However, I've come up with a halfway house.

A way to test your C# with Pipelines, but still output a Full Framework build.

You need Visual Studio 2017

You're going to create new .csproj files for .Net SDK rather than msbuild
You will use the new <TargetFrameworks> node rather than the default, singular <TargetFramework> node

Each DLL has 2 targets by default, the .Net Standard 2.0 and the .Net Full Framework 4.5.1
Each entry project, be it EXE, ASP.Net, etc, also has 2 targets, .Net Core 2.0 and .Net Full Framework 4.5.1

Two unfortunate, serious limitations exist:
1) You can't use Linq To Sql, you have to replace it or buy the drop in replacement LinqConnect by DevArt
2) You must either port your .Net web projects to ASP.Net MVC or Razer (any programming model older than that is not supported in ASP.Net Core) or test your ASP.Net web projects somewhere else

There's other changes, it's too much to list here, but by and large I've found most things "Just Work" until .Net Standard

So, your new DLL csproj files look like this:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net451</TargetFrameworks>
</PropertyGroup>

</Project>

Exe projects look like this:

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.0;net451</TargetFrameworks>
<AssemblyName>MyProj</AssemblyName>
<RootNamespace>RJ.MyProj</RootNamespace>
</PropertyGroup>
</Project>

By default, these include all files in your projects, as opposed to msbuild which includes zero files by default.

There's no GUI support for these project types yet. You need to hand write them. You'll need to put criteria in the references and nuget sections so each framework version has it's own section. You can add as many targets as you like, all the way back to .Net Framework 2.0! When you build these, it outputs (by default) 2 folders under bin. Their names match the target framework.

Once you get this working, you have two set of binaries. One is the full framework and it should be identical to what you built before.
The other binary is .Net Standard or Core and can be spun up and tested inside a .Net Core container in Pipelines.
The logic is that, for your business logic at least, if it passes your tests running under .Net Core, it's equivalent to passing under the full framework.
I'm still learning all this, I've only got to the point of everything compiling and it seems to run under both types of framework.
Most of the information I needed to learn to get this working so far came from this page:
MultiTargeting And Porting a .Net Library to .Net Core 2.0
It's a bit out of date, it's from when all of this stuff was in preview.
I know it's not what people are asking for, but it's the closest you can do without requiring live software to be ported to .Net Core
Good luck everybody! If I ever get an example project together, I'll post that here as well.

@PlanCZero I know you posted this a looong time ago but in case it may help you or others...
In our case, we really like Bitbucket but as we need to "Build" our .NET Framework projects we are using BitBucket and Azure DevOps together. So, we have a Pipeline defined in Azure DevOps getting the source code from BitBucket. 
Therefore, we are able to build our Windows .Net Framework projects in Azure Devops while still maintaining our code on BitBucket. They both integrate really well and you can get the Build status from both tools ;)

Hi @PlanCZero  I like this solution with Bitbucket and Azure DevOps but the issue is we are having IP Restriction on bitbucket, Is there way we can whitelist particular repo from IP-Restriction ?

Here are two blog posts about building .Net apps in Pipelines, using the docker image:

image: microsoft/dotnet

http://davevde.github.io/using-bitbucket-pipelines-with-aspnet-core/

http://davevde.github.io/bitbucket-pipeline-with-aspnet-core-and-webpack/

Thanks, @Sigge Birgisson. .NET Core is a bit too "shiny and new" to be adopted for our new client projects.

Do you know of any reference information that would help us understand the build and test running process for ASP.NET 4.x WebAPI solutions using NUnit 3?

Like Lenin Raj Rajasekaran likes this

@Dave Todaro Have you found any information on how to build ASP.NET 4.x solutions in Bitbucket Pipelines?

Like Lenin Raj Rajasekaran likes this

Are there any Docker images that have MSBuild on? I am having problems with Mono and my .NET solution (I don't use .NET core yet)

Any updates to this folks? MS has full docker support these days, when are we going to see that in pipelines?

Still no positive news on that?

Hi.

This is not an answer.

However it is a solution.

Look into using .Net Standard 2.0 and up.

Targeting .Net Standard allows your project to multi target .Net Full and .Net Core.

2.0 and up allows you to use most .net tools like MVC, razor and entities frame framework.

Your project can even be set up to produce multiple sets of binaries.

0 votes
devpartisan Atlassian Team May 02, 2017

What build tools do people use for .NET these days? When I last coded C# a couple years back, MS Build was pervasive, like it or not. But we liked to use a layer over it like psake or fake. Are people using those or others?

I recently reviewed a whole lot of CI tools - I use BB Pipelines for the Node frontend and Visual Studio Team Services for the .NET part. I have to say it has improved a LOT since I last used it a few years ago. The scrum tools are massively improved too. BuddyBuild is a fantastic CI tool but uses Mono for .NET. So I would check out VSTS. When BB comes out of beta I am moving all my Node projects to VSTS

Like Lenin Raj Rajasekaran likes this

I have same issue... my app is Console App / Windows Sevrice - 

.net 4.5 app and I would like to get it building in PIPELINEs.. Any chance for using msbuild?

Like Lenin Raj Rajasekaran likes this

We're currently evaluating Atlassian's BitBucket, Jira and Pipelines.

Everything's good except we're going to have to use msbuild for, well, everything.

No way we can move to .net core first.

What's the status on msbuild in a windows dock?

Like Lenin Raj Rajasekaran likes this

That example if for .NET Core and as the original question states is about: ".NET framework".

Like John Hutton likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

515 views 6 4
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