Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 6 #86

Open
VladislavAntonyuk opened this issue Feb 20, 2019 · 77 comments
Open

.NET 6 #86

VladislavAntonyuk opened this issue Feb 20, 2019 · 77 comments
Labels
build Related to App Center's Build service feature request New feature request reviewed-DRI Reviewed by DRI

Comments

@VladislavAntonyuk
Copy link

VladislavAntonyuk commented Feb 20, 2019

We have updated our project to .net 5 preview. But CI doesn't support it (.net core 3 is the latest). Please add support for .net 5

@VladislavAntonyuk VladislavAntonyuk added the feature request New feature request label Feb 20, 2019
@lumaxis lumaxis added the build Related to App Center's Build service label Feb 20, 2019
@stale
Copy link

stale bot commented May 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further requests are made to keep it open.

@stale stale bot added Stale and removed Stale labels May 21, 2019
@VladislavAntonyuk VladislavAntonyuk changed the title .Net Core 3 .Net 5 Jun 15, 2020
@wham
Copy link

wham commented Dec 3, 2020

We are working on .NET 5.0 support. Should be available by the end of the year.

@wham wham pinned this issue Dec 4, 2020
@wham
Copy link

wham commented Dec 18, 2020

We added .NET 5.0 this week. Please let us know if you notice any issues.

@wham wham closed this as completed Dec 18, 2020
@dersia
Copy link

dersia commented Dec 18, 2020

I just tried to run my pipeline again I am still getting an error CSC : error CS1617: Invalid option '9' for /langversion.
I updated the Xamarin.iOS version to 14.6

@wham
Copy link

wham commented Dec 19, 2020

Thanks for reporting. We'll take another look.

@wham wham reopened this Dec 19, 2020
@dersia
Copy link

dersia commented Dec 19, 2020

@MasterEmit
Copy link

I know this appcenter related and not azure devops, but I have the exact same problem with azure devops pipeline. Any idea how to solve that? Workaround?

Thanks and Greetz

@AlenaSviridenko
Copy link

Hi @MasterEmit, @dersia,
could you please provide minimal steps to reproduce, so we can make sure the issue is related to the image and not to the project configuration? Also, it will help us to investigate the issue deeper.
All our internal tests passed successfully for a variety of different projects.

Thank you.

@DenLavrov
Copy link

Same issue here. Any updates?

@chrisstaley
Copy link

I'm trying to compile a Xamarin Android app that references a .NET Standard library whose LangVersion is set to 9, and I'm getting the same error.

<PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <DebugType>portable</DebugType>
    <ProduceReferenceAssembly>true</ProduceReferenceAssembly>
    <Configurations>Debug;Test</Configurations>
    <LangVersion>9</LangVersion>
  </PropertyGroup>

@AdamDiament
Copy link

I have the same issue. My C Sharp 9 code has stopped compiling on app center android.

@AlenaSviridenko
Copy link

Hi folks,
Could you please share some repro steps? It would really help us investigate this issue deeper, because all our internal tests are passed, and we are not getting a lot of feedbacks about broken .NET 5 (which can be expected if there were some obvious and easily reproducible issue)

Thanks!

@chrisstaley
Copy link

@AlenaSviridenko I included the elements in the csproj file that will cause the failure. So repro steps would be:

  1. Create .NET Standard assembly project with those elements.
  2. Create Android app.
  3. Make Integrate diagnostics issues with Playfab Game Manager portal #2 reference Iteration Plan for February 2019 #1.
  4. Build in AppCenter.

@AdamDiament
Copy link

AdamDiament commented Jan 25, 2021

@AlenaSviridenko Repro:

  1. Create a .net standard 2.0 assembly project, set <LangVersion>Latest</LangVersion> in the csproj file.
  2. Create Xamarin android project, referencing the project in step 1.
  3. In the step 1 project, add a class/file containing any C#9 syntax, for instance advanced pattern matching or the new switch statements with operators
  4. Build locally - it will build
  5. Push to app center, it will fail

@dersia
Copy link

dersia commented Jan 31, 2021

Sorry it took me some time to come back to you.

Basically you just need a csproj file that has the following flag

<LangVersion>9</LangVersion>

I found a workaround for those who are still looking, but it only works with a custom build script (github action, azure pipelines)

Workaround

iOS

mono '/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/msbuild.dll' /p:Configuration=Release /p:Platform=iPhone <path/to/solutionfile.sln>

Android

mono '/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/msbuild.dll' /p:Configuration=Release /p:Platform=PackageForAndroid <path/to/android/project.csproj>

Why it works

using the MSBuild from the Path /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/ uses the MSBuild thats part of Visual Studio for Mac. VS4Mac has already c# 9 support, although mono does not. So this way you can compile C# 9 and .net5 code

Hope this helps

@ahmedalejo
Copy link

Hi folks,
Could you please share some repro steps? It would really help us investigate this issue deeper, because all our internal tests are passed, and we are not getting a lot of feedbacks about broken .NET 5 (which can be expected if there were some obvious and easily reproducible issue)

Thanks!

I´m not sure where your metrics are coming from but you should have noticed that there is a spike in build failures due to C# 9.0 syntax issues.

##[error]Error: The process '/Library/Frameworks/Mono.framework/Versions/6_12_3/bin/msbuild' failed with exit code 1

I had the following in my Xamarin.Forms app

if (e.Source is ShellNavigationSource.Pop or ShellNavigationSource.PopToRoot  or ShellNavigationSource.Remove)
{...}

Visual Studio Mac which is installed on Mac Build Agents could/should be used for building the dlls.
Or simply allowed as an alternative to using Mono directly.

@AdamDiament
Copy link

@dersia thanks for the workaround. What exactly do I do with your

mono '/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/msbuild.dll' /p:Configuration=Release /p:Platform=iPhone <path/to/solutionfile.sln>

Is this a build script I need to add in app center, or something in VS, or something else entirely?

@dersia
Copy link

dersia commented Feb 3, 2021

@AdamDiament
This is basically the Build-Step within your Build-Script. Unfortunately you can't run your own Build-Scripts directly in AppCenter at least as far as I know, so you will need another build-pipeline, that builds your app and then in another step pushes it to AppCenter. You can use either Github-Actions or Azure (DevOps) Pipelines.

If you need further help, please let me know.

@themronion
Copy link

@ECDev01 my instructions are for a mac build agent and a macos system respectively

@CharlyZest
Copy link

CharlyZest commented Aug 27, 2022

So there will be no official support for NET MAUI with NET 6?

@softlion
Copy link

So there will be no official support for NET MAUI with NET 6?

You can do the same with github actions, at x10 the price of appcenter (mac vm on github actions consumes x10 credits), and with a non intuitive and complicated UI and scripts (appcenter is simple to use, github actions are horrible).

@ECDev01
Copy link

ECDev01 commented Aug 29, 2022

I asked for help to appcenter support and they recommend Azure Pipelines, basically @ericbrunner suggestion, by the way, trying to install .NET 6 didn't work at all. Anyway, creating the pipeline for the building process is enough, so now I am building my app using Azure Pipelines (yaml) and the distribution is handled by appcenter.

@EdwardMcFlurry
Copy link

Any idea why iOS crashes when Android works well with AppCenter on .Net 6???

@EmilAlipiev
Copy link

Any idea why iOS crashes when Android works well with AppCenter on .Net 6???

This is good question and bugs me. I have a unit test project on .net 6 in xamarin.forms project. Basically looks like this

  • XF shared (.net standard 2.0)
  • Xamarin IOS
  • Xamarin Android
  • Unit test (.net 6)

On my build configuration, i have excluded Unit test project and I have choosen Project to be build as "IOS" project but Appcenter build is failing as ".net 6" not supported. Obviously there is a bug for IOS builds whatever you choose, it build all projects in the Project solution.
it all works fine on Android build.

@omatrot
Copy link

omatrot commented Oct 25, 2022

For anyone still seeking how to support c#10 in App Center - u need to find an msbuild file in your system, copy it and change the second path there to the location of MSBuild.dll that is bundled with VS 2022. Then, in a post-clone script copy this file from your project's directory to the directory where you've found it on your system. Voila, there u have it. Welcome and enjoy

Hi @themronion,
Could you please be a little more specific about this workaround, giving us sample paths and instructions that worked for you, as I hope it would help me solve .NET 6 iOS support on AppCenter.

Thanks in advance.

@mphill
Copy link

mphill commented Oct 25, 2022

We tried to do this (https://codetraveler.io/2019/08/23/using-preview-versions-of-net-core-with-app-center-build/
) to get .net 6 working on app center, but it still fails. The post-clone seemed promising but it doesn't work. I think app center has .net 5 hard coded in for the build step.

I don't even need .net 6 for our Xamarin app, but we have our API project in the same solution file - and app center tries to restore it. This has forced us to stick with .net 5 for our API.

Does any know how to work around this? I'd like to upgrade our APIs to .net 6 but app center builds then fail.

@omatrot
Copy link

omatrot commented Oct 27, 2022

I've tried to import the build definition into Azure DevOps after it has been exported from AppCenter.
But the problem remains, at the restore nuget task:

Starting: Restore Nuget
==============================================================================
Task         : Command Line
Description  : Run a command line with arguments
Version      : 1.1.3
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
==============================================================================
/bin/bash -c nuget restore 'TestApplication.sln' -DisableParallelProcessing
(node:1773) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:1773) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:1773) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:1773) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:1773) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:1773) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:1773) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:1773) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:1773) Warning: Use Cipheriv for counter mode of aes-256-ctr
MSBuild auto-detection: using msbuild version '15.0' from '/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/15.0/bin'.
/Users/runner/hostedtoolcache/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 6.0.  Either target .NET Core 5.0 or lower, or use a version of the .NET SDK that supports .NET Core 6.0. [/Users/runner/work/1/s/TestApplication/TestApplication.csproj]

##[error]/bin/bash failed with return code: 1
##[error]/bin/bash failed with error: /bin/bash failed with return code: 1
Finishing: Restore Nuget

So this is not related to AppCenter only, because of course, it is backed up by the Azure Devops infrastructure.
No surprise here, but a solution should be provided.

@AndreyPhilippov
Copy link

Any news here? I've also switched to net6.0-ios recently. Now I can't build my project with appcenter. Same problem as described above.

@jl-mobitech
Copy link

Still no updates? You guys promoting app center and maui and c# 10 and here we are in this issue :) Looks like MS does not care to the consumers :) y'all just promoting bunch of stuff that will be broke some time soon

@Umer-Mahmood-889
Copy link

Any updates on this?

@spatialdude
Copy link

See also #2500 which may be related to this issue, although I find Android, Windows and iOS targets are working with .NET MAUI + .NET 7, the problem is only with MacCatalyst.

@wisdeom
Copy link
Contributor

wisdeom commented Dec 12, 2022

Hi all! We support .NET 6 and MAUI in our latest SDK 5.0.1. Check out this release and let us know if you have any feedback. We'd love to hear from you. https://github.com/Microsoft/AppCenter-SDK-DotNet/releases

@wisdeom wisdeom closed this as completed Dec 12, 2022
@wisdeom wisdeom reopened this Dec 12, 2022
@mphill
Copy link

mphill commented Dec 16, 2022

@omatrot Since it appears that App Center is now abandonware try to add this to your pipeline:

- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '6.0.x'

@EmilAlipiev
Copy link

UI in our latest SDK 5.0.1. Check out this release and let us know if you have any feedback. We'd love to hear from you. https://github.com/Microsoft/AppCenter-SDK-DotNet/releases

that may solve the problem with Maui but how does this resolve issue with the Unit-tests targeting .net 6? Please see my other comment below.

Any idea why iOS crashes when Android works well with AppCenter on .Net 6???

This is good question and bugs me. I have a unit test project on .net 6 in xamarin.forms project. Basically looks like this

  • XF shared (.net standard 2.0)
  • Xamarin IOS
  • Xamarin Android
  • Unit test (.net 6)

On my build configuration, i have excluded Unit test project and I have choosen Project to be build as "IOS" project but Appcenter build is failing as ".net 6" not supported. Obviously there is a bug for IOS builds whatever you choose, it build all projects in the Project solution. it all works fine on Android build.

@faze79
Copy link

faze79 commented Apr 3, 2023

I have ASP.NETCore net6 application and in windows AppCenter fail to start...

@dedtechsolutions
Copy link

Eu tenho o aplicativo ASP.NETCore net6 e no Windows AppCenter falha ao iniciar ...

@isax5
Copy link

isax5 commented May 21, 2023

I can't compile with C# 10 and 11 yet, is everything too updated for AppCenter or what??

@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

@beeradmoore
Copy link

Bump

@EmilAlipiev
Copy link

Any idea why iOS crashes when Android works well with AppCenter on .Net 6???

This is good question and bugs me. I have a unit test project on .net 6 in xamarin.forms project. Basically looks like this

  • XF shared (.net standard 2.0)
  • Xamarin IOS
  • Xamarin Android
  • Unit test (.net 6)

On my build configuration, i have excluded Unit test project and I have choosen Project to be build as "IOS" project but Appcenter build is failing as ".net 6" not supported. Obviously there is a bug for IOS builds whatever you choose, it build all projects in the Project solution. it all works fine on Android build.

This is really getting worse and worse. Now Appcenter team changed something and i am getting error even for Android. Although my Build Configuration is targeting .Android.csproj not the solution file, Appcenter is building entire solution by ignoring the configuration file.

I can see that Appcenter uses a bash script that restores nuget and builds entire solution, not the specified Project in the configuration.
So if you are building Android, you can see in the logs that Nuget Restore and build is running also for IOS.

@beeradmoore
Copy link

AFAIK the downloading of all nugets isn't new.

We have post clone scripts that will delete other csproj files that we don't need restored. I'll try dig them up later when I am at my PC.

@beeradmoore
Copy link

This is our appcenter-post-clone.sh for our Android app. iOS app is similar but in reverse. Just update the .csproj and .sln and put it next to your MYAPP.Droid.csproj

#!/usr/bin/env bash
# App Center custom build scripts: https://aka.ms/docs/build/custom/scripts

echo "Disabling MYAPP.iOS.csproj to avoid updating nugets."

# Delete MYAPP.iOS from MYAPP.Forms.sln 
SLN_PATH=$BUILD_REPOSITORY_LOCALPATH/Software/MYAPP.Forms.sln
sed -i.bak '/MYAPP.iOS/{N;d;}' $SLN_PATH
rm -f ${SLN_PATH}.bak

# Delete MYAPP.iOS.csproj from the disk.
rm -f $BUILD_REPOSITORY_LOCALPATH/Software/MYAPP.Forms/MYAPP.iOS/MYAPP.iOS.csproj

@faze79
Copy link

faze79 commented Jan 18, 2024

I have ASP.NETCore net6 application and in windows AppCenter fail to start...

We have net 8 but this library still not support net 6 this is really frustrating...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to App Center's Build service feature request New feature request reviewed-DRI Reviewed by DRI
Projects
None yet
Development

No branches or pull requests