其他分享
首页 > 其他分享> > 解决 MAUI 在mac上编译提示 The path 'XXXXXXX\Shared\MainLayout.razor.css' would result in a file

解决 MAUI 在mac上编译提示 The path 'XXXXXXX\Shared\MainLayout.razor.css' would result in a file

作者:互联网

路径 '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

标签:razor,used,would,iOS,json,MAUI,Android,css
来源: https://www.cnblogs.com/densen2014/p/16581870.html