maui: [regression/8.0.3] [Bug] .net8 Android not building because Resources from resx not found.
Description
While migrating from .net7 to .net8 i was facing the issue that my app is not compiling in vs code and vs4mac on my mac.
I get a lot of errors like:
error CS0234: The type or namespace name 'Resources' does not exist in the namespace 'StringResourcesBug' (are you missing an assembly reference?)
caused by code like this:
var x = StringResourcesBug.Resources.Strings.Resource.Test;
After a lot of trial an error, I found out the reason for this is the name of the class in the Resource.Designer.cs file. If you create a rest file with the name Resource.resx you are running into this issue. Renaming the file to Resources.resx and the Class to Resources fixes the issue
But the project was building on .net6 and .net7. Also iOs version in .net8 with Resouce.resx is building and is able to run. So I looks like a Android specific thing to me.
Steps to Reproduce
- Clone the Repo
- Open the Solution in VSCode or VS4Mac
- Compile the Solution while Targeting Android Emulator
Link to public reproduction project repository
https://github.com/Larhei/Maui-Issues/tree/main/StringResourcesBug
Version with bug
8.0.3
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.101
Affected platforms
Android
Affected platform versions
all android
Did you find any workaround?
Renaming the resx file and the name of the class in *.Designer.cs
Relevant log output
No response
About this issue
- Original URL
- State: open
- Created 7 months ago
- Comments: 20 (12 by maintainers)
@last-Programmer not that I’m aware of. Its likely that VSForMac is not handling the new system, it might still be trying to make use of the old system. I’ll mention it to my collegue on the IDE team see if they can take a look.
I know. Its the inheritance, doh 🤦
@jonathanpeppers
Well I will try my best 😉