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
We are in the process of using dotnet run -- codegen write to prebuild types instead of adding them to the source code. Because our services has external dependencies like RabbitMq and Kafka it isn't possible to start the application in our CI environment. To fix this we need to add an enviroment variable like IsCli and use it to early out the registration of external services in the Startup file:
publicvoidConfigureServices(IServiceCollectionservices){
services.AddMarten<DatabaseConfig>();if(_configuration.IsCli())return;// Register service bus// Register kafka}
This is not optimal so are there any other good solutions to tackle this?
Marten could expose a method like GenerateTypes(..) that we could call during startup, that way we could delay our successful health checks to after runtime generation has finished. The problem with runtime generation today, is that it is too expensive to use in our production environment, and we have no way of knowing when everything has finished generating. The last option we could think of, is if the cli could use build time source generation instead of the current runtime compilation. This would make it much easier to execute during the build process, since it would not rely on the applications ability to actually start up, however this is properly no easy task.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi
We are in the process of using
dotnet run -- codegen write
to prebuild types instead of adding them to the source code. Because our services has external dependencies like RabbitMq and Kafka it isn't possible to start the application in our CI environment. To fix this we need to add an enviroment variable likeIsCli
and use it to early out the registration of external services in theStartup
file:This is not optimal so are there any other good solutions to tackle this?
Marten could expose a method like
GenerateTypes(..)
that we could call during startup, that way we could delay our successful health checks to after runtime generation has finished. The problem with runtime generation today, is that it is too expensive to use in our production environment, and we have no way of knowing when everything has finished generating. The last option we could think of, is if the cli could use build time source generation instead of the current runtime compilation. This would make it much easier to execute during the build process, since it would not rely on the applications ability to actually start up, however this is properly no easy task.Beta Was this translation helpful? Give feedback.
All reactions