adospace / reactorui-maui

MauiReactor is a MVU UI framework built on top of .NET MAUI
MIT License
555 stars 46 forks source link

Unable to use HotReload on .NET 8 #185

Closed bub-bl closed 6 months ago

bub-bl commented 7 months ago

When is use the following command: dotnet-maui-reactor -f net8.0-android, that work's fine, but when i do a change in MainPage.cs, i got this error and i dont know how to solve that (This is in french, but that always say "missing android target platform")

I have installed dotnet workload install android, but i get the same error, all workloads is installed

dotnet --list-sdks

dotnet --version

Logs:

C:\Users\bubbl\Desktop\TestProj>dotnet-maui-reactor -f net8.0-android --mode Full
MauiReactor Hot-Reload CLI
Version 1.0.154.0
Press Ctrl+C or Ctrl+Break to quit
Setting up build pipeline (full mode) for TestProj project...done.
Monitoring folder 'C:\Users\bubbl\Desktop\TestProj'...
Detected changes to 'Pages\MainPage.cs'
Detected changes to 'Pages\MainPage.cs'
Detected changes to 'Pages\MainPage.cs'
Version MSBuild 17.8.3+195e7f5a3 pour .NET
C:\Program Files\dotnet\sdk\7.0.404\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(113,5): error NETSDK1139: L'identificateur de la plateforme cible android n'a pas ├®t├® reconnu. [C:\Users\bubbl\Desktop\TestProj\TestProj.csproj]

I think, the problem is related to the SDK version used by dotnet-maui-reactor command. My global.json is set with this configuration:

{
  "sdk": {
    "version": "8.0.100"
  }
}

All nuget packages is updated and all is setup correctly following requirement in the documentation.

I don't have this problem when i use it with net7.0-android

adospace commented 6 months ago

Hi, I think you're using the wrong MauiReactor version, you need version 2.0.x to target .net 8.

First, install the latest tooling: dotnet new install Reactor.Maui.TemplatePack::2.0.7-beta

dotnet tool update --global Reactor.Maui.HotReload --version 2.0.7-beta

Then create a new project and set the references to the latest version:

    <PackageReference Include="Reactor.Maui" Version="2.0.7-beta" />
    <PackageReference Include="Reactor.Maui.Canvas" Version="2.0.7-beta" />
    <PackageReference Include="Reactor.Maui.ScaffoldGenerator" Version="2.0.7-beta" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>

running the hot-reload command you should see something like:

MauiReactor Hot-Reload CLI
Version 2.0.7.0
Press Ctrl+C or Ctrl+Break to quit
Setting up build pipeline for Project31 project...done.
Monitoring folder 'C:\Source\tests\Project31\\'...
adospace commented 6 months ago

Please let me know if you need further support otherwise I'll close the issue