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

2022/8/13 6:22:54

本文主要是介绍解决 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



这篇关于解决 MAUI 在mac上编译提示 The path 'XXXXXXX\Shared\MainLayout.razor.css' would result in a file的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程