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.86k stars 1.68k forks source link

CS0117: 'Resource' does not contain a definition for #22796

Open inimirpaz opened 1 month ago

inimirpaz commented 1 month ago

Description

(probably a VS for Mac issue)

See repro (Platforms/Android/MainActivity.cs): when you try to access the Resources you do not get autocompletion, rather you get a fake CS0117 error. It seems the partial class generated by the designer is empty:

    #pragma warning disable IDE0002
    public partial class Resource : _Microsoft.Android.Resource.Designer.ResourceConstant {
    }
    #pragma warning restore IDE0002

I say "fake" because the error is ignored and the application is built successfully (the resource is also properly resolved).

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/inimirpaz/maui_issues/tree/android_resource_issue

Version with bug

Unknown/Other

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 1 month 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:

Closed similar issues:

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

Zhanglirong-Winnie commented 1 month ago

Verified this issue with Visual Studio 17.6.12(build410)(8.0.40&8.0.3). Can repro this issue with sample project. image

ggbtvs commented 3 weeks ago

Is this likely to be fixed for VS for Mac BEFORE the app's retirement