You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to work with the sample for the Xamarin Forms but this seems to be using the older version. When creating a server and trying to serve up the HTML file for android I am getting a err_connection_refused when I try load up that URL. I have put the index.html file under Android/Assets/html also tried putting it in the root project folder under html. However I am somewhat unsure if this is just something I am missing?
protectedoverridevoidOnStart(){varurl="http://127.0.0.1:9696";// // Our web server is disposable.using(varserver= CreateWebServer(url)){
server.RunAsync();}}
privatestatic WebServer CreateWebServer(stringurl){varserver=new WebServer(o => o.WithUrlPrefix(url));
server.WithStaticFolder("/","html",true,m => m.WithContentCaching(false));// server.StateChanged += (s, e) => $"WebServer New State - {e.NewState}".Info();returnserver;}
public MainPage(){
InitializeComponent();
WebContent.Source ="http://127.0.0.1:9696/index.html";}
The text was updated successfully, but these errors were encountered:
lbabich
changed the title
Issue Serving Static Folder Xamarin Forms Android 3.5.2
Issue Serving Static Folder Xamarin ( 3.5.2) Forms on Android
Feb 15, 2024
I am currently trying to work with the sample for the Xamarin Forms but this seems to be using the older version. When creating a server and trying to serve up the HTML file for android I am getting a
err_connection_refused
when I try load up that URL. I have put the index.html file underAndroid/Assets/html
also tried putting it in the root project folder under html. However I am somewhat unsure if this is just something I am missing?The text was updated successfully, but these errors were encountered: