Skip to content

NullReferenceException when executing codegen write command #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
luber opened this issue Nov 16, 2023 · 1 comment
Open

NullReferenceException when executing codegen write command #3

luber opened this issue Nov 16, 2023 · 1 comment

Comments

@luber
Copy link

luber commented Nov 16, 2023

I have asp.net 8 project with next lines in Progam.cs:

if (args.Contains("codegen"))
{
    return await defaultHostBuilder.RunOaktonCommands(args);
}

When I start the app with next command args: dotnet MyApp.dll codegen write -
I can see that code was generated but at the end the process fails with next exception:

ERROR: System.NullReferenceException: Object reference not set to an instance of an object.
  at async ValueTask Marten.Events.EventGraph.DisposeAsync()                                                
  at async ValueTask Autofac.Core.Disposer.DisposeAsync(bool disposing)                                     
  at async ValueTask Autofac.Core.Lifetime.LifetimeScope.DisposeAsync(bool disposing)                       
  at async ValueTask Autofac.Core.Container.DisposeAsync(bool disposing)                                    
  at async ValueTask Autofac.Extensions.DependencyInjection.AutofacServiceProvider.DisposeAsync()           
  at async ValueTask Microsoft.Extensions.Hosting.Internal.Host.<DisposeAsync>g__DisposeAsync|21_0(object o)
  at async ValueTask Microsoft.Extensions.Hosting.Internal.Host.DisposeAsync()                              
  at void Microsoft.Extensions.Hosting.Internal.Host.Dispose()                                              
  at bool JasperFx.CodeGeneration.Commands.GenerateCodeCommand.Execute(GenerateCodeInput input)             
  at Task<bool> Oakton.OaktonCommand`1.Oakton.IOaktonCommand.Execute(object input)                          
  at Task<bool> Oakton.CommandRun.Execute()                                                                 
  at async Task<int> Oakton.CommandExecutor.execute(CommandRun run)                                         

Process finished with exit code 1.

@luber
Copy link
Author

luber commented Nov 16, 2023

    <PackageReference Include="Marten" Version="6.3.0" />
    <PackageReference Include="Marten.CommandLine" Version="6.3.0" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant