microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
192 stars 6 forks source link

.NET iOS project won't build with VS Code Mac & .NET Maui extension in Solution Explorer #1061

Open viswanath-pamarthi opened 4 weeks ago

viswanath-pamarthi commented 4 weeks ago

Describe the Issue

.NET iOS project won't build with VS Code Mac & .NET Maui extension using Solution explorer, instead noticed below error:

App Id: com.companyname.NativeiOSApp /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/tools/msbuild/iOS/Xamarin.Shared.targets(885,3): error MSB4018: The "ACTool" task failed unexpectedly. [/Users/MacUsername/LocalProjectsRepo/NativeiOSApp/NativeiOSApp/NativeiOSApp.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/tools/msbuild/iOS/Xamarin.Shared.targets(885,3): error MSB4018: System.IO.IOException: Read-only file system : '/Assets.xcassets' [/Users/MacUsername/LocalProjectsRepo/NativeiOSApp/NativeiOSApp/NativeiOSApp.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/tools/msbuild/iOS/Xamarin.Shared.targets(885,3): error MSB4018: at System.IO.FileSystem.CreateParentsAndDirectory(String fullPath, UnixFileMode unixCreateMode) [/Users/MacUsername/LocalProjectsRepo/NativeiOSApp/NativeiOSApp/NativeiOSApp.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/tools/msbuild/iOS/Xamarin.Shared.targets(885,3): error MSB4018: at System.IO.FileSystem.CreateDirectory(String fullPath, UnixFileMode unixCreateMode) [/Users/MacUsername/LocalProjectsRepo/NativeiOSApp/NativeiOSApp/NativeiOSApp.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/tools/msbuild/iOS/Xamarin.Shared.targets(885,3): error MSB4018: at System.IO.Directory.CreateDirectory(String path) [/Users/MacUsername/LocalProjectsRepo/NativeiOSApp/NativeiOSApp/NativeiOSApp.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/tools/msbuild/iOS/Xamarin.Shared.targets(885,3): error MSB4018: at Xamarin.MacDev.Tasks.ACToolTaskBase.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ACToolTaskBase.cs:line 277 [/Users/MacUsername/LocalProjectsRepo/NativeiOSApp/NativeiOSApp/NativeiOSApp.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/tools/msbuild/iOS/Xamarin.Shared.targets(885,3): error MSB4018: at Xamarin.MacDev.Tasks.ACTool.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs:line 12 [/Users/MacUsername/LocalProjectsRepo/NativeiOSApp/NativeiOSApp/NativeiOSApp.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/tools/msbuild/iOS/Xamarin.Shared.targets(885,3): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/Users/MacUsername/LocalProjectsRepo/NativeiOSApp/NativeiOSApp/NativeiOSApp.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8043/tools/msbuild/iOS/Xamarin.Shared.targets(885,3): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/Users/MacUsername/LocalProjectsRepo/NativeiOSApp/NativeiOSApp/NativeiOSApp.csproj]

Steps To Reproduce

  1. Install .NET MAUI extension, C# extension for VS Code mac, and .NET iOS workload
  2. In a Mac terminal or VSCode Mac terminal create a native iOS project with command "dotnet new iOS"
  3. Open project folder in VS Code Mac, and use the Solution explorer, right-click on the native iOS project and select "Build"
  4. You will see bundle identifier is needed error even though info.plist exists(which might be another issue), include info.plist explicitly in project file using ""
  5. Build the project again, you will notice the error with message "MSB4018: The "ACTool" task failed unexpectedly." as mentioned in bug description.

Expected Behavior

Using "Build", "Rebuild" options we should be able to build native iOS project with VSCode Mac using .NET Maui extension.

Environment Information

mauroa commented 4 weeks ago

Thanks @viswanath-pamarthi. Solution explorer build and debug is not supported for MAUI yet, but we are working on it. In the meantime you can select the "build only" debug target from the '{}' at the bottom right, and hit F5. It's an alternative for building a project without debugging, that will be removed once the right click support is completed.

viswanath-pamarthi commented 3 weeks ago

@mauroa Got it, thank you for the workaround. We weren't explicitly working on MAUI app, we are utilizing maui extension in Vs code Mac to work on .net-ios and .net-android native apps.

JRosanowski commented 3 weeks ago

@mauroa Any rough time frame when iOS support might be fully functional?