dotnet / MobileBlazorBindings

Experimental Mobile Blazor Bindings - Build native and hybrid mobile apps with Blazor
MIT License
1.2k stars 168 forks source link

Path not supported - Build failure IOS #375

Closed whann0205 closed 2 weeks ago

whann0205 commented 3 years ago

Unable to copy file "..\AssetQueryApp\wwwroot\css\AssetQuery.css" to "C:\Users\HANN~1.HAN\AppData\Local\Temp\Xamarin\HotRestart\Signing\AssetQueryApp.iOS.app\out\Payload\AssetQueryApp.iOS.app\D:\VCSource\repos\AssetQueryApp\AssetQueryApp\wwwroot\css\AssetQuery.css". The given path's format is not supported. AssetQueryApp.iOS

Regardless which Version of Visual Studio i always get this message if it try to build IOS. It does not matter if put to a local device or to a remote mac. As i can see above there is are two backslashes before the Drive Letter which looks like it assumes to have an UNC Path! --> \D: Can you please help me fix that ?

Eilon commented 3 years ago

Can you share what the CSPROJ looks like?

whann0205 commented 3 years ago

AssetQueryApp.iOS.zip AssetQueryApp.Android.zip

I have included both android csproj and the ios one.

whann0205 commented 3 years ago

Its not only within that application. It can be tested simply creating a new project based on your template Build your first hybrid app... Here Again Android no problem with IOS the infamous path not supported error!

whann0205 commented 3 years ago

Tested again with a different computer. But again the projects folder is on a different harddisk D: Same problem - path not supported error. Unable to copy file "..\FirstBlazorHybridApp\wwwroot\css\open-iconic\font\fonts\open-iconic.svg" to "C:\Users\Annem\AppData\Local\Temp\Xamarin\HotRestart\Signing\FirstBlazorHybridApp.iOS.app\out\Payload\FirstBlazorHybridApp.iOS.app\D:\Vcsource\source\repos\FirstBlazorHybridApp\FirstBlazorHybridApp\wwwroot\css\open-iconic\font\fonts\open-iconic.svg". The given path's format is not supported

FirstMobileBlazorBindingsApp buillds ok and runs even on a iphone6! Are hybrid supposed to work on the ios platform? Any help would be highly appreciated

Eilon commented 3 years ago

Hi @whann0205 I just installed the Mobile Blazor Bindings templates on a new Windows computer and it all seemed to run fine for both iOS (through the remote iOS Simulator) and locally on Windows. Everything compiled and ran as expected.

I see HotRestart showing up in the path names of the error message you have. I wonder if you have some option in VS enabled that I don't have enabled?

Eilon commented 3 years ago

Also, can you check exactly which version of VS you have? Open the VS that you were using for this project, go to Help/About, press "Copy Info", and paste here.

whann0205 commented 3 years ago

Hi Eilon! Sorry for the delay, but i wanted to test every possible thing before posting. Below you find the info pasted from Copy Info inside VS. I have updated VS yesterday to the latest version 16.10.2 because i hoped that it maybe solves my problem, but unfortuneatly it does not or not fully. Before i have been using 16.10.1 which configuration i have pasted as well. For easier troubleshooting i installed your example application with dotnet new blazorhybrid -o FirstBlazorHybridApp. I can confirm that deploying to a remote mac´s simulator does indeeed work now! With or without hot restart enabled, although vs studio hangs afterwards. Deploying to the local device results in that infamous part not supported error. Hot Restart must be enabled in order to be able to deploy to the locally attached iphone, so its not possible to try without hot restart. Tested again with my app against the remote mac and its working now, yah!! With 16.10.1 it wasn´t even possible to deploy to the remote mac i got MessagingRemoteException: An error occurred on client Build1610000230 while executing a reply for topic xvs/build/execute-task/FirstBlazorHybridApp.iOS/17bd5ba002fACTool IOException: Sharing violation on path /Users/xcodeclub/Library/Caches/Xamarin/mtbs/builds/FirstBlazorHybridApp.iOS/17bd5ba7e8b828e834e23c166e9ea1b3f47ef313acadf9480788415842b317f3/Assets.xcassets/AppIcon.appiconset/Contents.json FirstBlazorHybridApp.iOS Again locally attached iphone fails to build with this project and getting the path not supported error. Naturally it would be quite nice to test the application on a real device. Maybe i can fetch the ipa and use itunes to deploy to that device? Many thanks for trying to help! I know that this project is experimental, but i hope it gets released soon. Its so exciting to use blazor and c# for programming on mobile devices! I tried .net6 preview 4 also for that matter but quit it because i got much more troubles, but will definitly watch that progress here, too.

CONFIGURATION Visual Studio from Windows NOW:

Microsoft Visual Studio Professional 2019 Version 16.10.2 VisualStudio.16.Release/16.10.2+31410.357 Microsoft .NET Framework Version 4.8.04084

Installed Version: Professional

Visual C++ 2019 00435-60000-00000-AA726 Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019 16.10.526.50910 ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.10.526.50910 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.10.526.50910 Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.10.526.50910 Azure Functions and Web Jobs Tools

C# Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Color Theme Designer 1.0 Designer for creating new color themes

ColorCoder 1.0 Color Coder provides semantic coloring for C# and VB - http://hamidmosalla.com/color-coder/

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.40423.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.1.113+g422d40002e.RR Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.2 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.10.15 (552afdf) Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.10.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

QueryFirstCmd Extension 1.0 QueryFirstCmd Visual Studio Extension Detailed Info

Razor (ASP.NET Core) 16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725 Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 16.0.62105.04180 Microsoft SQL Server Data Tools

TypeScript Tools 16.0.30429.2002 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 16.10.0-beta.21262.7+1b23bbeda88ea3cb9be9af777f4c99fa8663df81 Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Foo 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

Xamarin 16.10.000.231 (d16-10@8111164) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.10.0.115 (remotes/origin/c750fbf1bde3c720d077f51640fe197c6dac7cbe@c750fbf1b) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.10.5 (355b57a) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 11.3.0.4 (d16-10/ae14caf) Xamarin.Android Reference Assemblies and MSBuild support. Mono: b4a3858 Java.Interop: xamarin/java.interop/d16-10@f39db25 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0

Xamarin.iOS and Xamarin.Mac SDK 14.20.0.10 (0e35b2e0b) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

CONFIGURATION Visual Studio from Windows BEFORE:

Microsoft Visual Studio Professional 2019 Version 16.10.1 VisualStudio.16.Release/16.10.1+31402.337 Microsoft .NET Framework Version 4.8.04084

Installed Version: Professional

Visual C++ 2019 00435-60000-00000-AA726 Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019 16.10.526.50910 ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.10.526.50910 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.10.526.50910 Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.10.526.50910 Azure Functions and Web Jobs Tools

C# Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Color Theme Designer 1.0 Designer for creating new color themes

ColorCoder 1.0 Color Coder provides semantic coloring for C# and VB - http://hamidmosalla.com/color-coder/

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.40423.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.1.113+g422d40002e.RR Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.2 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.10.15 (552afdf) Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.10.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

QueryFirstCmd Extension 1.0 QueryFirstCmd Visual Studio Extension Detailed Info

Razor (ASP.NET Core) 16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725 Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 16.0.62105.04180 Microsoft SQL Server Data Tools

TypeScript Tools 16.0.30429.2002 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 16.10.0-beta.21262.7+1b23bbeda88ea3cb9be9af777f4c99fa8663df81 Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Foo 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

Xamarin 16.10.000.230 (d16-10@0e66389) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.10.0.115 (remotes/origin/c750fbf1bde3c720d077f51640fe197c6dac7cbe@c750fbf1b) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.10.5 (355b57a) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 11.3.0.1 (d16-10/22fc2b3) Xamarin.Android Reference Assemblies and MSBuild support. Mono: b4a3858 Java.Interop: xamarin/java.interop/d16-10@f39db25 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0

Xamarin.iOS and Xamarin.Mac SDK 14.20.0.3 (17fdcf569) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

ghost commented 3 years ago

Any updates on this or workarounds? Encountered the issue today with the template in VS2022.

whann0205 commented 3 years ago

Have not tested with the latest Visual Studio 2019 nor VS2022 due to lack of time. Fact is i still cannot deploy to a local attached iphone and i am using the remote ios simulator on a remote mac i rented. Do not know who is in charge for this problem and i hope eilon will help to solve that problem or report that to the vs team. But you know building the future has its drawbacks :-)

Eilon commented 3 years ago

I haven't had time to take a look at this yet. If you can test this with a regular Xamarin.Forms app that could be helpful to identify if there's any issue specific to Mobile Blazor Bindings, or if it's a more general Visual Studio or Xamarin issue.

whann0205 commented 2 years ago

Updated Visual Studio to 16.11.1 und all nuget Packages. I can post the version numbers in detail if necessary. Build works now flawlessly, without the path not supported error.

But now i get 2 new errors: The path '......\mudblazor\2.0.7\staticwebassets\MudBlazor.min.css' would result in a file outside of the app bundle and cannot be used. AssetQueryApp.iOS C:\Users\hann.HANN-EDV.nuget\packages\mudblazor\2.0.7\staticwebassets\MudBlazor.min.css
and The path '......\mudblazor\2.0.7\staticwebassets\MudBlazor.min.js' would result in a file outside of the app bundle and cannot be used. AssetQueryApp.iOS C:\Users\hann.HANN-EDV.nuget\packages\mudblazor\2.0.7\staticwebassets\MudBlazor.min.js

Then i tested and the results as follows: myapp --> Android Emulator --> OK no error myapp --> Android Local Device --> OK no error myapp --> IOS local Device --> Error as to be read above myapp --> IOS Remote Simulator on a remote mac --> OK no error!!!! TodoApp (regular Xamarin Forms App) --> IOS local device --> OK no error TodoApp (regular Xamarin Forms App) --> IOS Remote Simulator --> OK no error

Eilon commented 2 years ago

Hmm I've never seen that error with the bundle in MobileBlazorBindings, but I've seen it in .NET MAUI with Blazor Desktop and here's how we worked around it:

https://github.com/dotnet/maui/blob/b4b2d1172d029c7cf356eb6f824938edafc89c99/src/BlazorWebView/src/Maui/build/Microsoft.AspNetCore.Components.WebView.Maui.targets#L32-L49

But eventually we hope to get a real fix in the iOS SDK.

whann0205 commented 2 years ago

Many thanks for your quick answer! Eilon as a relatively new guy to c# and build options, how can i implement the fix in my enviroment?

Eilon commented 2 years ago

Can you try copying those exact highlighted lines into your app's main CSPROJ file?

whann0205 commented 2 years ago

I did try to copy those lines in the app main csproj file. Try to build the solution - failed again with the same error message. My csproj begins with

netstandard2.1 true 3.0 false wwwroot true So it differs a lot from the one you have for net.maui, i have copie your lines at the end of the csproj just before the closing tag . Tried with the csproj located inside the ios folder This file begins with the following lines. Debug iPhoneSimulator 8.0.30703 2.0 {CED6C0DF-ABCB-4784-B63F-1959FE7A4F4D} {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} {6143fdea-f3c2-4a09-aafa-6e230626515e} Exe AssetQueryApp.iOS Resources AssetQueryApp.iOS true NSUrlSessionHandler automatic Did copy again at the end of the file just before the closing tag. Still no luck. Again i did see there is also a csproj.user file. Maybe i should copy those lines there?
whann0205 commented 2 years ago

I have seen that its not possible to post that lines directly into this textfield so i attached the modified csproj files here for you to view. csproj.zip

whann0205 commented 2 years ago

Any ideas on this topic, or do you need more information ?

Eilon commented 2 years ago

It might be a while until I can take a closer look. If you're only using BlazorWebView for building hybrid apps, I recommend using .NET MAUI with Blazor Desktop, which will be officially released later this year. You can learn more in this blog post from the recent preview 7 release: https://devblogs.microsoft.com/dotnet/announcing-net-maui-preview-7/