Project names containing a valid characters now cause errors on project generation (for iOS or MacCatalyst, and Android) #26645
Labels
area-setup
Installation, setup, requirements, maui-check, workloads, platform support
platform/android 🤖
platform/iOS 🍎
platform/macOS 🍏
macOS / Mac Catalyst
potential-regression
This issue described a possible regression on a currently supported version., verification pending
s/triaged
Issue has been reviewed
t/bug
Something isn't working
Milestone
Description
Previously valid characters included on the project or solution name are now causing the iOS and MacCatalyst versions of apps to fail to build.
Ok, so the "valid" characters in question are ones you might not expect, but this still leads to weird exception messages.
The valid characters in question are:
_
@
(
)
These are all "technically" valid characters in a project name but have started to cause issues with iOS and Mac Catalyst compilation in the latest VS previews. (And, presumably the .net 9 previews too)
When a project is created that includes one of these characters in the project or solution name, the newly generated project immediately reports errors (due to a failed design time compilation.)
These characters did not cause a problem previously.
While the above characters aren't valid in types and namespaces, they are all correctly substituted with underscores in code files.
It's not an issue with the project or solution settings. The problem is the use of these characters inside the file path.
It's possible to create directory that includes one or more of these characters and then create a project in that location that only includes alphanumeric characters but still produces the same errors.
I expect a change has been made with the mac/iOS tooling that doesn't correctly escape file paths.
X-Ref: #23839 and #26486 (similar issues relating to the inclusion of an underscore but only affecting Windows)
For additional reference, I have the following installed:
Steps to Reproduce
Maui_@()App
The Error List includes:
Expected: the generated project should load without issue.
Note that the Windows version of the generated project will build and run without issue.
The Android version of the project fails to build with XAPRAS7004
No project repro link included as it happens on new project generation. - I can add one if it will really make a difference.
Link to public reproduction project repository
No response
Version with bug
9.0.21 SR2.1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
9.0.0 GA
Affected platforms
macOS, iOS, Android
Affected platform versions
No response
Did you find any workaround?
The workaround is to not have these characters in the file paths of anything included in the solution.
I assume this will be very low priority but it would be good if the project name validation could be updated when creating a new project and/or if the error messages displayed could better point to the real cause of the issue.
Relevant log output
The text was updated successfully, but these errors were encountered: