dotnet / eShop

A reference .NET application implementing an eCommerce site
MIT License
6.06k stars 1.77k forks source link

Do not know how to start App,Pls someone give me some advice? #548

Open roooneychina opened 3 weeks ago

roooneychina commented 3 weeks ago

app loaderror

First I open eShop.Web.slnf using VS2022.start eshop.AppHost then I open eShop.sln using VS2022 ,start HybridApp,chocing android local device,

at last,connect to PC via my android cellphone USB,in order to run the eshop APP ,but the app prompt:an unhandled error has occurred.Reload. is there someone could give me some advice. Do I need to change some configration? Many thanks

zikezhang commented 1 week ago

Hi @roooneychina ,

you might refer to the video: https://www.youtube.com/watch?v=vRZ8ucGac8M

roooneychina commented 1 week ago

Hi @roooneychina ,

you might refer to the video: https://www.youtube.com/watch?v=vRZ8ucGac8M

Many thanks, let me try it later

jamesmontemagno commented 3 days ago

If you have the API running, double check the mobile bff url.

Inside of the HybridApp project in MauiProgram.cs you will see:

internal static string MobileBffHost = "http://localhost:11632/";

That is where it is trying to reach it. Run the app on Windows and that should work for you.

For Android it is complicated with emulators as they can't talk localhost and need http clear text setup. This is setup in the normal clientapp. It could be setup like this: https://learn.microsoft.com/en-us/dotnet/maui/data-cloud/local-web-services?view=net-maui-8.0#android

I have done it in this branch for .NET 9: https://github.com/dotnet/eShop/pull/581

Specifically: https://github.com/dotnet/eShop/pull/581/commits/48a9da8f299c463da418fdd6d347112d53a5ed7b