dbosoft / hosuto Goto Github PK
View Code? Open in Web Editor NEWAdvanced application hosting with .NET Generic Host and Asp.Net Core.
License: MIT License
Advanced application hosting with .NET Generic Host and Asp.Net Core.
License: MIT License
Beside Microsofts DI container and SimpleInjector we should also add support for the top used DI containers.
see also https://www.claudiobernasconi.ch/2019/01/24/the-ultimate-list-of-net-dependency-injection-frameworks/ for a list of containers.
Autofac, Ninject and Lamar (instead of StructureMap) would be good first candidates.
ConfigureContainer method on Module fails if method arguments contains injected services.
For web modules the ConfigureContainer method is not called. Also the ConfigureContainer extensions are not called.
The current extension Services are called before the module Methods are invoked.
It is not possible to handle both: modifications before method is called and modifications after method is called (for example for testing).
Instead a filter should be used like the aspnetcore filters or middleware.
Instead of building a ServiceProvider from the service collection like
it would be better to create a custom service provider that uses the service collection to create instances directly. We would loose the abilility to resolve dependencies in this case, but such services are not supported here anyway.
for example like this:
ConfigureAppConfiguration
has currently no effect on ModulesHost
.
This leads to problem when configuration should be available before module configuration, especially from ModulesHost.CreateDefaultBuilder
.
return ModulesHost.CreateDefaultBuilder(args) //not applied to app host
.ConfigureHostConfiguration(config => config //applied to app host
).ConfigureAppConfiguration((ctx, config) => //not applied to app host
{
})
Currently - as ModulesHost
is a generic host - the environment will be loaded from a DOTNET_ENVIRONMENT
variable.
However - it is very common that instead only ASPNETCORE_ENVIRONMENT
is used.
See also: https://docs.microsoft.com/de-de/aspnet/core/fundamentals/environments?view=aspnetcore-5.0
Maybe we should also override DOTNET_ENVIRONMENT
with ASPNETCORE_ENVIRONMENT
for ModulesHost
Services are resolved to early when dependencies are still have to be registered, for example when added to the SimpleInjector container later.
AddSimpleInjector also contains a option argument that for example simplifies the use of HostedServices.
We should add a AddSimpleInjector convention based method like UseSimpleInjector (see below):
Currently a generic version of IModuleServicesConfigurer is missing. A generic implementation would make it simpler to add ConfigureServices extensions for specific modules.
Blazor needs the file <Module Assembly>.StaticWebAssets.xml
from module to load the assets.
During build the file for the module itself is not copied to output directory of referencing apps.
This is ok in a "normal" web app, but as in Hosuto each module will use the module assembly name as application name (this is a requirement of razor and some other aspnetcore feature).
Current workaround is to copy the missing file from the module directory to all apps using the module. However it would be better when this could be automated with a build task.
The AddSimpleInjector method is never called.
Since 0.2.0 the AssemblyParts of WebModules are no longer found. Therefore Controllers and Razor Views are no longer loaded.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.