Skip to content
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

Make RazorMail independent of ASP.NET #7

Open
ricardoboss opened this issue Nov 17, 2023 · 1 comment
Open

Make RazorMail independent of ASP.NET #7

ricardoboss opened this issue Nov 17, 2023 · 1 comment

Comments

@ricardoboss
Copy link
Member

Is it possible to remove the dependency on ASP.NET?

Currently, when using the following code, I get some obscure error messages about service that are not registered:

var builder = Host.CreateDefaultBuilder(args)

builder.AddRazorEmailRenderer();

var host = builder.Build();

await host.RunAsync();

It would be nice to be able to use the razor pipeline without a hard dependency on ASP.NET.

The workaround currently consists of replacing the builder with a ASP.NET web app builder:

var builder = WebApplication.CreateBuilder(args);

// ...

Also, all services using the IRazorEmailRenderer need to be scoped, which ideally would not be necessary.

@chucker
Copy link
Collaborator

chucker commented Nov 21, 2023

See also prototypes/console-sample-app branch

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

2 participants