uno 平台自动生成的文件和程序中出错.cs - 仅在 Mac 上



我有一个简单的基于un uno平台的应用程序。在Windows上,我可以毫无问题地构建和运行它。但是在 VS for Mac 上,编译器会给自动生成的 RemoteControl.g.cs 文件错误:

  • 错误 CS0826:找不到隐式类型数组的最佳类型 (CS0826( (UnoTeszt.Wasm(
  • 错误 CS1503:参数 2:无法从"?[]' to 'string[]' (CS1503( (UnoTeszt.Wasm(
// <auto-generated>
// ***************************************************************************************
// This file has been generated by the package Uno.UI.RemoteControl - for Xaml Hot Reload.
// Documentation: https://platform.uno/docs/articles/features/working-with-xaml-hot-reload.html
// ***************************************************************************************
// </auto-generated>
// <autogenerated />
#pragma warning disable // Ignore code analysis warnings
[assembly: global::Uno.UI.RemoteControl.ServerEndpointAttribute("fe80::1%1", 0)]
[assembly: global::Uno.UI.RemoteControl.ServerEndpointAttribute("fe80::109d:3e33:34e7:51fb%4", 0)]
[assembly: global::Uno.UI.RemoteControl.ServerEndpointAttribute("10.111.111.61", 0)]
[assembly: global::Uno.UI.RemoteControl.ServerEndpointAttribute("fe80::5805:f7ff:feaa:6ec3%8", 0)]
[assembly: global::Uno.UI.RemoteControl.ServerEndpointAttribute("fe80::5805:f7ff:feaa:6ec3%9", 0)]
[assembly: global::Uno.UI.RemoteControl.ServerEndpointAttribute("fe80::1d3:92b1:ff7d:cf5%10", 0)]
[assembly: global::Uno.UI.RemoteControl.ServerEndpointAttribute("fe80::77d1:f7a1:4393:622b%11", 0)]
[assembly: global::Uno.UI.RemoteControl.ProjectConfigurationAttribute(
@"/Users/kistelekig/Documents/Vitarex/FilmesApp/UnoTeszt/UnoTeszt/UnoTeszt.Wasm/UnoTeszt.Wasm.csproj",
new[]{}
)]

我在程序中还有另一个问题.cs:

[...]/UnoTeszt/UnoTeszt.Wasm/Program.cs(20,20(:错误 CS0246:找不到类型或命名空间名称"App"(是否缺少 using 指令或程序集引用?(CS0246((UnoTeszt.Wasm(

using System;
using Windows.UI.Xaml;
namespace UnoTeszt.Wasm
{
public class Program
{
private static App _app;
static int Main(string[] args)
{
Windows.UI.Xaml.Application.Start(_ => _app = new App());
return 0;
}
}
}

我安装了最新版本的 VS for Mac 和 MacOS。

当项目中没有标记为<Page />的 XAML 文件时,通常会发生这种情况。确保正确引用共享项目。

我找到了根本问题。当我通过 dotnet new 创建项目时:

dotnet new -i Uno.ProjectTemplates.Dotnet
dotnet new unoapp -o App-CrossPlatform

我有下一个共享项目

App-CrossPlatformApp-CrossPlatform.SharedApp-CrossPlatform.Shared.shproj
App-CrossPlatformApp-CrossPlatform.SharedApp-CrossPlatform.Shared.projitems

但是在其他(android,ios(项目中,还有下一个导入:

<Import Project="..App_CrossPlatform.SharedApp_CrossPlatform.Shared.projitems" Label="Shared" Condition="Exists('..App_CrossPlatform.SharedApp_CrossPlatform.Shared.projitems')" />

是的。。。符号-_...

我创建了一个问题: https://github.com/unoplatform/uno/issues/4217

最新更新