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
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.
We are working on .NET 5.0 support. Should be available by the end of the year.
We added .NET 5.0 this week. Please let us know if you notice any issues.
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
Thanks for reporting. We'll take another look.
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
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.
Same issue here. Any updates?
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>
I have the same issue. My C Sharp 9 code has stopped compiling on app center android.
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!
@AlenaSviridenko I included the elements in the csproj file that will cause the failure. So repro steps would be:
@AlenaSviridenko Repro:
<LangVersion>Latest</LangVersion> in the csproj file.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)
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>
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>
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
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.
@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
Is this a build script I need to add in app center, or something in VS, or something else entirely?
@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.
@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.
@dersia If I am right then AppCenter does support build scripts. I have never used build scripts before, is it just a case of copying the line of code into an appcenter-pre-build.sh file? What would the path to solution file be then?
Thanks!
Hi guys, any updates?
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 codeHope this helps
Hello ! I struggle with your workaround, I'm basically trying to do the same, an azure pipeline who take a Xamarin forms 5.0 project in C#9 and every time I try to do the mono script that you give for android, I got an error, with
/Users/runner/.nuget/packages/xamarin.forms/5.0.0.2012/buildTransitive/Xamarin.Forms.targets(125,4): error MSB4064: The "ValidateOnly" parameter is not supported by the "XamlCTask" task. Verify the parameter exists on the task, and it is a settable public instance property.
With a csproj given after that, i check in this csproj file, and I never use stuff like "ValidateOnly" after many times on Google someone has the same error within visual studio, but I find no one with this error on an azure pipeline.
If you have any cloud, of what could be at the origin of this error. That will be a life safer to me.
Cl茅ment.
@wham @nilofer 6 months since it was understood that this was going to be looked into. Is there any update on it?
@derana I appreciate the workaround. However, setting up a new CI/CD pipeline on an alternative service isn't a workaround as much as it is jumping ship.
EDIT: It appears nilofer is possibly no longer working on this project. Sorry for the tag.
Recently in one of the updates I saw that there was a way to eliminate the bar. Someone removed the default "Sign In" message and showed how to remove the bar via android manifest.
It's not the ideal way but it worked.
I need to try still on iOS
@wham @davidortinau @maddyleger1 @hartez @StephaneDelcroix @jsuarezruiz do you have any news about when will be possible to build Xamarin Forms projects on AppCenter using the new C# 9 syntax on our code?
currently delcaring field on any of my own call like below fails to build on AppCenter
MyClass _obj = new();
Good afternoon is anyone looking into this ? We are still having trouble building Lang 9 via App Center.
+1 for some movement on this. Has been nearly 2.5 years
Still an issue for me. Bump. I'd like to be able to use C#10 soon too!
Most helpful comment
Hi guys, any updates?