You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Underscore _
At sign @
Open bracket (
Close bracket )
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:
When the project opens in VS, wait a few seconds and then see errors:
The Error List includes:
Severity Code Description Project File
Error (active) NETSDK1082 There was no runtime pack for Microsoft.NETCore.App available for the specified RuntimeIdentifier 'iossimulator-x64'. Maui_@()App (net9.0-ios) C:\Program Files\dotnet\sdk\9.0.200-preview.0.24575.35\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets 495
Error (active) NETSDK1082 There was no runtime pack for Microsoft.NETCore.App available for the specified RuntimeIdentifier 'maccatalyst-x64'. Maui_@()App (net9.0-maccatalyst) C:\Program Files\dotnet\sdk\9.0.200-preview.0.24575.35\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets 495
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
System.ArgumentException: must not be null or empty
Parameter name: abi
at Xamarin.Android.Tasks.ProcessAssemblies.SetAssemblyAbiMetadata(String abi, ITaskItem assembly, ITaskItem symbol) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs:line 103
at Xamarin.Android.Tasks.ProcessAssemblies.SetMetadataForAssemblies(List`1 output, Dictionary`2 symbols) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs:line 128
at Xamarin.Android.Tasks.ProcessAssemblies.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs:line 62
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25
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:
On a related note, I've also discovered that in the latest preview, VS can't cope with relative project paths that contain spaces when creating links between projects in the same solution.
Maybe it would be easier if MAUI enforced only alphanumeric characters (and dot/period) in all file names and paths.
@mrlacey We have discussed this issue in #26092. Actually, these errors are caused by special characters in project name. If you have no other questions, we will close this issue.
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: