Click here to Skip to main content
15,894,825 members

Comments by Magnus Sydoff (Top 6 by date)

Magnus Sydoff 17-Sep-22 8:01am View    
Thanks @Graeme_Grant
I've watched the video and really tried hard to apply the ideas mentioned (even though they did not use a console application as starting point). However I still fail to get the UI to show up properly. It is just shown as poor html page without any css or equivalent at all.

I hope that you would be able to give just a short push in the right direction.
Thanks in advance,
Magnus
Magnus Sydoff 11-Sep-22 6:25am View    
(Since a reply can't seem to contain formatting, I've put an image here instead.
Hopefully it says more than the 1000 words.... ;-) )

https://imgur.com/a/vHrrY5j
Magnus Sydoff 11-Sep-22 6:11am View    
Thank you for your answer @Graeme_Grant

I've tried to read up on Blazor Hybrid, but I can't really see how I should go about it.

Basically the Blazor app looks like this

-----------------------------

public class MyProgram
{
public static void Main(string[] args)
{
new OurTestBlazorApp().Start();
}
}


public class OurTestBlazorApp
{
public void Start()
{
var builder = WebApplication.CreateBuilder();
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<weatherforecastservice>();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
}
app.UseStaticFiles();
app.UseRouting();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.Run();
}
}

-----------------------------

and it works just as expected (great that is) whereas the regular console application looks like this

-----------------------------

new OurTestBlazorApp().Start();

-----------------------------

When I start the alternative console application (which as you see call the Blazor server app) the functionality of weather forecast (fetch data) and the counter works but it looks awkward with no graphics.


I'm still under the impression that there is just a small setting / tweak somewhere that needs to be done but I might be totally wrong here.

King regards
Magnus
Magnus Sydoff 4-Sep-22 4:19am View    
Thanks @TimWallace for your answer. I wrote something that might not be a factory but solves the problem anyway. I'll post it in case someone else might need something similar.
Magnus Sydoff 17-Jan-22 13:05pm View    
Hi _Asif,

Yes, I looked at that article, but if I'm not misreading it, it just gives me a value in return, not wiring up my services.

I have ended up writing my own implementation that reads from a json file and then looks at the defined interfaces and classes and wires it up.

Thanks!