radimitrov / CSharpShellApp

77 stars 18 forks source link

Refit not works #384

Open sedoLevi609 opened 1 week ago

sedoLevi609 commented 1 week ago

@radimitrov Nas.zip it seems Refit not working with maui in your app(when I launch the maui app i see the c# shell maui plugin app view,not my view). Example is the above uploaded zip(first you need to export the dlls from CommonNASLibrary and NASServerLibrary as dll(from NASFileSyncher(maui app) you need to reference both CommonNASLibrary(also tried in both as dll) and NASServerLibrary as dll)(contains libraries for maui app,both NASServerLibrary and NASFileSyncher use CommonNASLibrary,which is inside NASServerLibrary solution,which is only used by NASFileSyncher which is the maui app). Please help me to make it to work!(In the maui app if you comments out .AddNASServer() when injecting services and also comments out INasServer parameter from MainPageViewModel constructor then it works,but theres no rest API then)

radimitrov commented 1 week ago

For some reason I'm getting "Position 14:3. DataTemplateExtension: Could not locate type for local:MainPage". The only difference is that I've referenced NASServerLibrary and CommonNASLibrary as projects? So there might be another issue here. I have ran tests tests and dependency injection appears to work as expected. Though I think you should add App and AppShell to DI and inject them where needed.

sedoLevi609 commented 1 week ago

@radimitrov "Position 14:3. DataTemplateExtension: Could not locate type for local:MainPage" doesn't matters if you export to APK(it shows for some reason but shouldn't since everything is correct ,I exported to APK and that's where the strange things happen as you can see in the attached video.

https://github.com/radimitrov/CSharpShellApp/assets/51722783/d182789c-9e27-4056-945f-3555d0944faf

radimitrov commented 1 week ago

Hmm, I'm getting a better result with APK. Though I did tinker with the project a tiny bit. Yours should still show something. It looks like in your case the assembly isn't included?bI will investigate next week.

Screenshot_2024-06-22-07-39-53-93_b783bf344239542886fee7b48fa4b892.jpg

NasTest.zip

sedoLevi609 commented 1 week ago

Registering and injecting AppShell and App as you did not solves my issue. I will try reference the libraries as projects.

sedoLevi609 commented 1 week ago

@radimitrov How can I reference the 2 libraries as projects from other solution as you did?

radimitrov commented 1 week ago

@sedoLevi609 From left drawer panel solution -> Add existing project -> Pick the .csproj(s)

References menu -> Add project reference

sedoLevi609 commented 1 week ago

Now I see the view too,seems like it solved the issue