HavenDV / Mvvm.Navigation

Provides platform independent navigation at the MVVM level and a Source Generator that automatically binds view and view models and registers this in your DI container
MIT License
19 stars 0 forks source link

No AddMvvmNavigation() method and Exception from ServiceCollectionExtensions #62

Open WoistdasNiveau opened 1 day ago

WoistdasNiveau commented 1 day ago

Describe the bug

Created new Avalonia Project in .net 9, created new IServiceCollection, but no .AddMvvmNavigation() extension method. While building error CS0759: For the implementing declaration of the partial method "ServiceCollectionExtensions.AddViewsAndViewModels(IServiceCollection)" was no declaration found. This happens at the Mvvm.Navigation.Generators\H.Generators.DependencyInfectionGenerator\ServiceCollectionExtensions.

It seems like the ServiceCollectionExtensions.d.g is missing as it is in my old project but not in my new, in the new one is just the .i.g

Steps to reproduce the bug

  1. Start new Avalonia Crossplatfrom solution
  2. Install Microsoft.Extensions.DependencyInjection nuget package
  3. Install Mvvm.Navigation.Avalonia nuget package

Expected behavior

Should be able to use the AddMvvmNavigation() extension method and do not get a building exception from a partial method outside my scope.

Screenshots

image

NuGet package version

Navigation: 1.5.1 DI: 9.0.0 Avalonia: 11.2.1

Platform

Avalonia

IDE

Other

Additional context

No response

HavenDV commented 20 hours ago

This method is created via Source Generator, and I think the problem might be in .net 9 - can you try compiling this in net 8?