kistelekig
kistelekig

Reputation: 175

Error in uno platform auto generated file and program.cs - only on Mac

I have a simple app based un uno platform. On Windows I can build and run it without any problem. But on VS for Mac the compiler gives error to the auto generated RemoteControl.g.cs file:

// <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[]{}
)]

And I have an other problem as well in the Program.cs:

[...]/UnoTeszt/UnoTeszt.Wasm/Program.cs(20,20): Error CS0246: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?) (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;
    }
  }
}

I have the latest version of VS for Mac and MacOS installed.

Upvotes: 3

Views: 365

Answers (2)

xtmq
xtmq

Reputation: 3693

I have found the root issue. When I create a project via dotnet new:

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

I have the next shared project

App-CrossPlatform\App-CrossPlatform.Shared\App-CrossPlatform.Shared.shproj
App-CrossPlatform\App-CrossPlatform.Shared\App-CrossPlatform.Shared.projitems

But in other (android, ios) projects there are the next imports:

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

Yes... Symbol - vs _...

I have created an issue: https://github.com/unoplatform/uno/issues/4217

Upvotes: 0

Carl de Billy
Carl de Billy

Reputation: 961

This usually happens when there's no XAML files tagged as <Page /> in your project. Make sure to correctly reference your shared project.

Upvotes: 2

Related Questions