Closed anantashrit closed 1 year ago
Update......................
On executing the line - ".WithWebApi("/api", m => m.WithController
Message: Controller type must have a public parameterless constructor. (Parameter 'controllerType')
at EmbedIO.WebApi.WebApiModuleBase.RegisterControllerType(Type) + 0xf3
at EmbedIO.Samples.Program.<>c.
Ofcourse I added a parameterless constructor to PeopleController and tried again. Same error continues.
Then I checked the EmbedIO implementation.
WebApiModuleExtensions class has ->
public static WebApiModule WithController
No issue with embedIO. Had to add runtime directives. Works..!
Requirement : Deploy a natively compiled tiny server on a windows PC. Natively compiled because it is better in terms of security. MSIL can be reverse engineered easily even after sufficient obfuscation.
Steps tried: Change the target framework to net7.0 Addtrue to the EmbedIO.Samples.csproj file
Ensure that it works in debug mode. Console launches, starts the server and starts the browser, shows the embedio GUI from html folder, api/people works etc.
Now create a publish profile targeting win-x64, Release x64 mode.
Publish to a folder. Ensure that publish is successful.
Run the EmbedIO.Samples.exe generated.
Expected : Console launches, starts the server and starts the browser, shows the embedio GUI from html folder, api/people works etc.
Observed: Console launches, starts the browser but the browser shows "unable to connect"
IDE used : Visual Studio 2022 professional
Is it not possible to natively compile for Windows, a console application just like the EmbedIO.Samples that acts as a server using EmbedIO package?