unoplatform / uno.templates

Uno Platform project templates
https://platform.uno/
Other
16 stars 11 forks source link

C# Markup+Fluent fails to build #653

Closed jeromelaban closed 5 months ago

jeromelaban commented 5 months ago

Discussed in https://github.com/unoplatform/uno/discussions/16417

Originally posted by **mcNets** April 23, 2024 Hello. After updating the new extension and getting OK from uno-check, I've generated a new UNO project. I've selected C# Markup and Fluent theme and I let all the rest as is. I'm using Visual Studio 17.10.0 Preview 4.0 I'm getting these errors: ``` Rebuild started at 14:54... 1>------ Rebuild All started: Project: Uno52, Configuration: Debug Any CPU ------ Restored C:\Test\Uno52\Uno52\Uno52.csproj (in 1,29 sec). 1>C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 1>C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 1>C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 1>C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 1>C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 1>C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 1>C:\Test\Uno52\Uno52\Presentation\Shell.cs(16,26,16,56): error CS0307: The property 'LoadingView.LoadingContentTemplate' cannot be used with type arguments 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(10,18,10,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(14,22,14,33): error CS1955: Non-invocable member 'NavigationBar.MainCommand' cannot be used like a method. 1>C:\Test\Uno52\Uno52\Presentation\MainPage.cs(11,18,11,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>Done building project "Uno52.csproj" -- FAILED. 1>C:\Test\Uno52\Uno52\obj\Debug\net8.0-android\unoresizetizer\sp\drawable\uno_splash_image.xml(2): error APT2260: resource drawable/splash_screen (aka com.companyname.Uno52:drawable/splash_screen) not found. 1>C:\Test\Uno52\Uno52\obj\Debug\net8.0-android\unoresizetizer\sp\drawable\uno_splash_image.xml(2): error APT2260: 1>C:\Test\Uno52\Uno52\obj\Debug\net8.0-android\unoresizetizer\sp\drawable-v31\uno_splash_image.xml(2): error APT2260: resource drawable/splash_screen (aka com.companyname.Uno52:drawable/splash_screen) not found. 1>C:\Test\Uno52\Uno52\obj\Debug\net8.0-android\unoresizetizer\sp\drawable-v31\uno_splash_image.xml(2): error APT2260: 1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\Xamarin.Android.Aapt2.targets(156,3): error APT2061: failed linking file resources. 1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\Xamarin.Android.Aapt2.targets(156,3): error APT2061: 1>Done building project "Uno52.csproj" -- FAILED. 1>C:\Test\Uno52\Uno52\Presentation\Shell.cs(16,26,16,56): error CS0307: The property 'LoadingView.LoadingContentTemplate' cannot be used with type arguments 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(10,18,10,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(14,22,14,33): error CS1955: Non-invocable member 'NavigationBar.MainCommand' cannot be used like a method. 1>C:\Test\Uno52\Uno52\Presentation\MainPage.cs(11,18,11,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>Done building project "Uno52.csproj" -- FAILED. 1>C:\Test\Uno52\Uno52\Presentation\Shell.cs(16,26,16,56): error CS0307: The property 'LoadingView.LoadingContentTemplate' cannot be used with type arguments 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(10,18,10,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(14,22,14,33): error CS1955: Non-invocable member 'NavigationBar.MainCommand' cannot be used like a method. 1>C:\Test\Uno52\Uno52\Presentation\MainPage.cs(11,18,11,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>Done building project "Uno52.csproj" -- FAILED. 1>C:\Test\Uno52\Uno52\Presentation\Shell.cs(16,26,16,56): error CS0307: The property 'LoadingView.LoadingContentTemplate' cannot be used with type arguments 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(10,18,10,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(14,22,14,33): error CS1955: Non-invocable member 'NavigationBar.MainCommand' cannot be used like a method. 1>C:\Test\Uno52\Uno52\Presentation\MainPage.cs(11,18,11,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>Done building project "Uno52.csproj" -- FAILED. 1>C:\Test\Uno52\Uno52\Presentation\Shell.cs(16,26,16,56): error CS0307: The property 'LoadingView.LoadingContentTemplate' cannot be used with type arguments 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(10,18,10,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>C:\Test\Uno52\Uno52\Presentation\SecondPage.cs(14,22,14,33): error CS1955: Non-invocable member 'NavigationBar.MainCommand' cannot be used like a method. 1>C:\Test\Uno52\Uno52\Presentation\MainPage.cs(11,18,11,26): error CS1061: 'Grid' does not contain a definition for 'SafeArea' and no accessible extension method 'SafeArea' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?) 1>Done building project "Uno52.csproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== ========== Rebuild completed at 14:54 and took 05,019 seconds ========== ```
jeromelaban commented 5 months ago

A temporary workaround is to add the following reference:

  <ItemGroup>
    <PackageVersion Include="Uno.Toolkit.WinUI.Markup" Version="6.0.18" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Uno.Toolkit.WinUI.Markup" />
  </ItemGroup>
mcNets commented 5 months ago

The workaround do the trick.

jeromelaban commented 5 months ago

An update to the template is also needed.

dansiegel commented 5 months ago

Screenshot 2024-05-08 at 11 03 13 AM This seems to be resolved with the latest stable release