Maui Blazor 中文社区 QQ群:645660665

解决 MAUI 在mac上编译提示 The path 'XXXXXXX\Shared\MainLayout.razor.css' would result in a file outside of the app bundle and cannot be used

路径 'XXXXXXX\Shared\MainLayout.razor.css' 将导致应用程序包之外的文件并且无法使用

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

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

解决

这个问题最近在为本地 iOS 硬件目标构建时浮出水面。除了删除/删除未引用的 razor 文件之外,还需要明确排除以下 json 文件。是的,launchSettings.json与位于 Android 平台层次结构中的google-services.json文件一样被引用。

  <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>

https://github.com/dotnet/maui/issues/4061#issue-1099499420

posted @ 2022-08-13 03:02  AlexChow  阅读(241)  评论(0编辑  收藏  举报