thinktecture / ttconftool-blazor

MIT License
1 stars 0 forks source link

Startup constructor parameters not supported in Photino.Blazor #1

Open MafuJosh opened 3 years ago

MafuJosh commented 3 years ago

When running TTConfTool.Desktop, it errors out when trying to instantiate the Startup class.

System.MissingMethodException HResult=0x80131513 Message=No parameterless constructor defined for type 'TTConfTool.Desktop.Startup'. Source=System.Private.CoreLib StackTrace: at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache) in /_/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs:line 4008

From looking at the source code, Photino.Blazor doesn't seem to support any injection into the constructor, and requires a constructor without any parameters. https://github.com/tryphotino/photino.Blazor/blob/72e46b275f84d654b7a0b98030ab81797c7f997b/Photino.Blazor/ComponentsDesktop.cs#L129

I realize you are experimenting and running into some other problems yourself or maybe this exact problem, but thought I'd share what I've learned. I'm building and running this on a Windows 10 machine.

The background on why I was trying out your code is that I have a similar solution of Blazor projects where I've separated out the main Blazor application into a shared project and then created separate projects for Blazor Server and Blazor WebAssembly, and now experimenting with adding Blazor Photino. I noticed you have a similar setup and I was struggling and thought I'd see if I could learn something from yours.

After commenting out some things, I run into another problem, regarding it not finding "_content" files, which is the problem I am having in my project. But that is scope for another issue.

ChristianWeyer commented 3 years ago

Hy @MafuJosh - yes, exactly: this is a playground app to see how Blazor WASM itself, as well as MudBlazor, and now also Photino, behaves beyond Hello World samples.

Currently, it does not even start on macOS, so I did not yet bother to look further.

Thanks for the hint and heads-up!