Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The path 'XXXXXXX\Shared\MainLayout.razor.css' would result in a file outside of the app bundle and cannot be used. #4061

Closed
nssidhu opened this issue Jan 11, 2022 · 24 comments
Assignees
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView feature-blazor-sdk Issues related to Blazor and various other SDKs (Razor, iOS, Android, etc.) platform/iOS 🍎 t/bug Something isn't working

Comments

@nssidhu
Copy link

nssidhu commented Jan 11, 2022

Description

The error happens with Blazor MAUI Hybrid Project.
Project compile and runs without error for Android, Android Local device & windows emulator platform and even works for iOS simulator,
but runs into compiler issues for iOS Local Device

Steps to Reproduce

  1. Create Blazor MAUI hybrid App
  2. Change to iOS local Device
  3. It will start showing .css related Error

Version with bug

Preview 11

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS Local Device

Did you find any workaround?

No

Relevant log output

No response

@nssidhu nssidhu added the t/bug Something isn't working label Jan 11, 2022
@jsuarezruiz jsuarezruiz added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Jan 11, 2022
@aokocax
Copy link

aokocax commented Jan 11, 2022

Same thing happened to me, when I delete the files it works but it needs to be fixed.

@aokocax
Copy link

aokocax commented Jan 13, 2022

Update: If I choose iOS remote device (Connect via Mac) It doesn't give that error and works perfectly.

@nssidhu
Copy link
Author

nssidhu commented Jan 13, 2022

yes, the error only comes when using iPhone local device. it works with iPhone simulator(connected via Mac)

@Siphonophora
Copy link

Same thing happened to me, when I delete the files it works but it needs to be fixed.

I did the same thing. Deleting the two css files does allow it to build. After deploying with hot restart to iPhone, this crashes when I actually start the app.

@Magic73
Copy link

Magic73 commented Jan 15, 2022

I have the same issue, and if I remove the files the app crash just before loading the Blazor app (not the maui one).

@mkArtakMSFT
Copy link
Member

Potentially related to #3546

@FelipeCostaGualberto
Copy link

Yes, I can confirm, it is happening when I try to deploy in my iPad.

@mosamario
Copy link

By disabling Blazor CSS isolation like shown in Microsoft Docs i am able to run the app without crashing on my iphone but obviously without any css working. Maybe this information helps to find a suitable workaround...

@SteveSandersonMS
Copy link
Member

Note that there's more context about this at #2981

@javiercn
Copy link
Member

@SteveSandersonMS should this be closed in favor of the issue you pointed out?

@SteveSandersonMS
Copy link
Member

I considered it, but #2981 seems to imply there is already a workaround that fixes this. It's not clear from #2981 alone that we really have to do more work. So I think this issue is a better one to represent the fact that there's a real bug affecting customers.

We could close #2981 as a dupe but it's not really a duplicate as it's saying we already have a workaround. So I'd be OK with just leaving it alone.

@javiercn
Copy link
Member

@SteveSandersonMS I think this is addressed by 6c99396 as described here
#3014 (comment) from more digging I did yesterday.

@javiercn javiercn self-assigned this Feb 24, 2022
@javiercn
Copy link
Member

This got addressed by #4861

@tvkit
Copy link

tvkit commented Mar 9, 2022

This issue recently surfaced when building for a local iOS hardware target. In addition to removing/deleting unreferenced razor files, it was also necessary to explicitly exclude the following json files. Yes, launchSettings.json was being referenced as was the google-services.json file located within the Android platform hierarchy.

  <ItemGroup Condition="$(TargetFramework.EndsWith('-ios'))">
    <None Remove="Properties\launchSettings.json" />
    <None Remove="Platforms\Android\google-services.json" />
    <Content Remove="Properties\launchSettings.json" />
    <Content Remove="Platforms\Android\google-services.json" />
  </ItemGroup>

VS 2022 Preview

Microsoft Visual Studio Community 2022
Version 17.2.0 Preview 1.0
VisualStudio.17.Preview/17.2.0-pre.1.0+32210.308
Microsoft .NET Framework
Version 4.8.04084

...

Xamarin   17.2.0.35 (main@13fdda6)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.2.0.31 (remotes/origin/main@489d90aeb)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   17.1.13 (bb31b34)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   12.2.99.75 (main/398afd4)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: a5d1934
    Java.Interop: xamarin/java.interop/main@32635fd6
    ProGuard: Guardsquare/proguard/v7.0.1@912d149
    SQLite: xamarin/sqlite/3.37.2@51b4821
    Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0e80ea1

Xamarin.iOS and Xamarin.Mac SDK   15.7.0.163 (fa0342922)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

@mkArtakMSFT mkArtakMSFT added this to the 6.0.300-preview.14 milestone Mar 24, 2022
@Eilon Eilon removed this from the 6.0.300-preview.14 milestone Apr 12, 2022
@Eilon
Copy link
Member

Eilon commented Apr 12, 2022

Re-opening because there is a new report of this on Twitter: https://twitter.com/Benzadeus/status/1513999791478521857

@Eilon Eilon reopened this Apr 12, 2022
@FelipeCostaGualberto
Copy link

Hi and thanks Eilon!

Today I updated to use my Visual Studio 2022 17.2.0 Preview 3.0 so I could use MAUI Release Candidate 1. I created a brand new .NET MAUI Blazor App (Preview) and noticed that a bug I had before got fixed, but I still get the one of this topic.

When I try to run the default template - without any changes - it runs perfectly in Android / Windows Machine, but when I try deploying in my iOS Local Devices >> Felipe's iPad, I got the error of the topic. If I delete the files MainLayout.razor.css and NavMenu.razor.css, it works perfectly in my iPad (without the CSS styling, of course).

I have an iPad Air (3rd Generation), version 15.4.1.

@Eilon
Copy link
Member

Eilon commented Apr 12, 2022

@FelipeCostaGualberto great, thank you for the details! Do you have a Mac with the iOS/iPadOS simulator to also test on?

@FelipeCostaGualberto
Copy link

@Eilon , I don't have a Mac. I'll see if my friend with a Mac can help me with that. If I get something new, I'll post here.

@Eilon
Copy link
Member

Eilon commented Apr 13, 2022

@FelipeCostaGualberto sure thing. We will investigate this too.

@FelipeCostaGualberto
Copy link

@Eilon I managed to get a Mac and the bug doesn't happen in the iOS simulator (iPod touch 7th gen version 15.4), everything is fine.

I also tested with my wife's iPhone (physical device) and I got the same error I was getting with iPad with .razor.css files.

So it might be only a issue with Local Devices.

@Eilon
Copy link
Member

Eilon commented Apr 13, 2022

I wonder if it's the same as this issue: #5245

@mkArtakMSFT
Copy link
Member

Closing as we believe that this was fixed. And this is not a dupe of #5245

@robpaveza
Copy link

@mkArtakMSFT I recently re-encountered this with VS 17.2 Preview 5. It is (as noted previously) an issue with a local device -- I haven't tried deploying to an iPhone attached to a remote Mac yet.

@BasBBakker
Copy link

I have the same problem. Version 17.2.0 Preview 5.0

@ghost ghost locked as resolved and limited conversation to collaborators May 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView feature-blazor-sdk Issues related to Blazor and various other SDKs (Razor, iOS, Android, etc.) platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests