dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.72k forks source link

Maui platform symbols still broken in Vstudio 2022 #24366

Open mariolerma opened 3 weeks ago

mariolerma commented 3 weeks ago

Description

if you use #if ANDROID OR ANDROID the code not highlight correctly neither compiles.

Steps to Reproduce

image

Link to public reproduction project repository

No response

Version with bug

Unknown/Other

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

API30

Did you find any workaround?

Not yet

Relevant log output

No response

github-actions[bot] commented 3 weeks ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Zhanglirong-Winnie commented 3 weeks ago

This issue has been verified using Visual Studio 17.12 Preview 1 (8.0.80 & 8.0.72). Can repro on android platform.

jfversluis commented 3 weeks ago

@mariolerma can you share a bit more about your situation? Because the dropdown doesn't seem to indicate that you are targeting Android? And we are using these directives all over our code and they work fine there. Could you maybe put together a reproduction project that shows this behavior and share the Visual Studio version that you're working with?

mariolerma commented 3 weeks ago

the problem occurs when you use the vstudio 2022 Maui MultiProject.. i will test it on Single Maui MultiPlatform to see what happends

On Thu, Aug 22, 2024 at 2:41 AM Gerald Versluis @.***> wrote:

@mariolerma https://github.com/mariolerma can you share a bit more about your situation? Because the dropdown doesn't seem to indicate that you are targeting Android? And we are using these directives all over our code and they work fine there. Could you maybe put together a reproduction project that shows this behavior and share the Visual Studio version that you're working with?

— Reply to this email directly, view it on GitHub https://github.com/dotnet/maui/issues/24366#issuecomment-2303994726, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3ZWAR5KJF2S4NSRPWFZDLZSWI4PAVCNFSM6AAAAABM44B6SWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTHE4TINZSGY . You are receiving this because you were mentioned.Message ID: @.***>

mariolerma commented 3 weeks ago

I just tested it on single Maui multiplatform single project the ANDROID symbol is defined however, if you select android target, looks gray out, but the code is evaluated correctly, i mean, it checked for errors. the debugger breakpoint skips other platforms correctly, so is something in the code highlighting.

In the MultiProject Maui, the debug symbols are completely broken.

Regards

On Thu, Aug 22, 2024 at 7:40 AM mario lerma @.***> wrote:

the problem occurs when you use the vstudio 2022 Maui MultiProject.. i will test it on Single Maui MultiPlatform to see what happends

On Thu, Aug 22, 2024 at 2:41 AM Gerald Versluis @.***> wrote:

@mariolerma https://github.com/mariolerma can you share a bit more about your situation? Because the dropdown doesn't seem to indicate that you are targeting Android? And we are using these directives all over our code and they work fine there. Could you maybe put together a reproduction project that shows this behavior and share the Visual Studio version that you're working with?

— Reply to this email directly, view it on GitHub https://github.com/dotnet/maui/issues/24366#issuecomment-2303994726, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3ZWAR5KJF2S4NSRPWFZDLZSWI4PAVCNFSM6AAAAABM44B6SWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTHE4TINZSGY . You are receiving this because you were mentioned.Message ID: @.***>

drasticactions commented 2 weeks ago

@mariolerma For your "MultiProject" MAUI application, where is this code you have written above? Is it in a class project? A shared project? If it's a class library, does it include the Android Target Framework (net8.0-android)?

The ANDROID symbol doesn't come from MAUI UI. It's a runtime preprocessor definition that gets added when you reference an Android TFM (net8.0-android, for example) in your class project, unless you are defining this yourself somewhere (which you probably shouldn't, if so)

I agree with @jfversluis, I think we need to see a project repro to know exactly what you're doing.

mariolerma commented 2 weeks ago

Very simple to reproduce. Try this [image: image.png] on this [image: image.png] an in the onclick event of the sample try to add some code that works only for android using the #if ANDROID directive.

Regards, ML

On Mon, Aug 26, 2024 at 3:15 AM Tim Miller @.***> wrote:

@mariolerma https://github.com/mariolerma For your "MultiProject" MAUI application, where is this code you have written above? Is it in a class project? A shared project? If it's a class library, does it include the Android Target Framework (net8.0-android)?

The ANDROID symbol doesn't come from MAUI UI. It's a runtime preprocessor definition that gets added when you reference an Android TFM ( net8.0-android, for example) in your class project, unless you are defining this yourself somewhere (which you probably shouldn't, if so)

I agree with @jfversluis https://github.com/jfversluis, I think we need to see a project repro to know exactly what you're doing. I created a new template MAUI Single project.

— Reply to this email directly, view it on GitHub https://github.com/dotnet/maui/issues/24366#issuecomment-2309619392, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3ZWAU74MOVVVE7UIEXBBTZTLP3BAVCNFSM6AAAAABM44B6SWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBZGYYTSMZZGI . You are receiving this because you were mentioned.Message ID: @.***>

jfversluis commented 2 weeks ago

The images are missing

mariolerma commented 2 weeks ago

I'm attaching the images..

On Mon, Aug 26, 2024 at 8:00 AM Gerald Versluis @.***> wrote:

The images are missing

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

mrstrong79 commented 1 week ago

Broken for me also

mariolerma commented 1 week ago

Latest update, they fix the symbols, but the #IF ANDROID directive is not highlighted correctly in code

On Wed, Sep 4, 2024 at 6:58 PM mrstrong79 @.***> wrote:

Broken for me also

— Reply to this email directly, view it on GitHub https://github.com/dotnet/maui/issues/24366#issuecomment-2330342944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3ZWAQ4AHFRSA6KLYX2LADZU6NA7AVCNFSM6AAAAABM44B6SWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZQGM2DEOJUGQ . You are receiving this because you were mentioned.Message ID: @.***>

PureWeen commented 5 days ago

Can we close this one @mariolerma ?

mariolerma commented 5 days ago

Nope, The symbols are good now but the highlighting is not, when you set #IF DEBUG, is not highlighted correctly

On Fri, Sep 6, 2024 at 8:06 PM Shane Neuville @.***> wrote:

Can we close this one @mariolerma https://github.com/mariolerma ?

— Reply to this email directly, view it on GitHub https://github.com/dotnet/maui/issues/24366#issuecomment-2334980839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3ZWAQXMGKLG6XIFJBKQ43ZVJGSPAVCNFSM6AAAAABM44B6SWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZUHE4DAOBTHE . You are receiving this because you were mentioned.Message ID: @.***>