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

Why is my Xamarin.iOS app being compiled with C# 8 even though the project specifies version 9? #15524

Closed
salgiza opened this issue Nov 22, 2021 · 3 comments
Assignees
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug question Task: XamariniOS

Comments

@salgiza
Copy link

salgiza commented Nov 22, 2021

Type: Question

Enter Task Name: XamariniOS

Environment

  • Server - Azure Pipelines
  • Agent - Hosted

Issue Description

I have a Xamarin app/sln where all the csproj files have lang version 9 specified in them, in all of their built configurations:

<LangVersion>9.0</LangVersion>

and I've defined 'macOS-latest' as the vmImage. The thing is that, no matter what I do, I always get this kind of errors when the app is being compiled in the XamariniOS task:

Feature 'xxxx' is not available in C# 8.0. Please use language version 9.0 or greater.

I mean, I don't even get an error message saying that c# 9 is not supported or anything, the agent just seems to be ignoring the lang version defined in the project and trying to compile it using c# 8 :(

I even tried to compile the app using bash instead of the XamariniOS task (as mentioned here: #14171 ), but I got the same result.

And, of course, the task that compiles the android version of the app, using the same vmImage, does it without any problems (and compiling the iOS version locally works fine as well).

I would really appreciate it if anyone could point me to what could be causing the XamariniOS task to ignore the LangVersion specified in the csproj files (I'm sure it must be something silly, but I'm totally stuck).

@github-actions github-actions bot added Area: ABTT Akvelon Build Tasks Team area of work question Task: XamariniOS triage labels Nov 22, 2021
@EzzhevNikita EzzhevNikita added bug and removed triage labels Nov 22, 2021
@anatolybolshakov
Copy link
Contributor

Hi @salgiza sorry for the delay - could you please share your pipeline logs in debug mode? You can send them to my email - [email protected]

@anatolybolshakov anatolybolshakov self-assigned this Jan 31, 2022
@salgiza
Copy link
Author

salgiza commented Feb 1, 2022

Hi @anatolybolshakov, I just sent the logs to your email (just wanted to confirm that I was the author of the email! 🙂 ).

@anatolybolshakov
Copy link
Contributor

Per logs investigation - seems that this warning comes from msbuild itself, and task generates command properly for this tool - I would suggest to open a ticket in msbuild repo to get right eyes on it.
I'm closing this one as external at the moment - @salgiza please let us know if you have any other questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug question Task: XamariniOS
Projects
None yet
Development

No branches or pull requests

3 participants