-
Notifications
You must be signed in to change notification settings - Fork 10.3k
How to use DI in ICompileModule #328
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
Comments
Why are you trying to extend what seems like the application via an ICompileModule? |
It was a suggestion by yourself here to follow the pattern of razorprecompiler. I may have misunderstood..? |
Ah is this the T4MVC replacement? |
yes, so was just looking at the razorprecompiler and it makes a bit more sense now I'm a bit more familiar with a few bits. So should I be creating a service collection just for the compiler module to use, that seems to be what razorprecompiler is doing? |
Yes but currently, things generated by ICompileModules don't show up for intellisense in visual studio or omnisharp right now. |
ok, I am writing the r4mvc gen'd file out to disk which avoids that issue as it gets picked up by the compiler second time around, again probably a horrible thing to do but I just don't know any better at the moment :) |
…xtending the hostapp as per discussion dotnet/aspnetcore#328 (comment)
Looking for guidance in using IServiceProvider within the context of an ICompileModule.
I am creating a new appbuilder, passing in the existing IServiceProvider passed from the host app but was wondering if this is considered improper use. Example code can be found at the links
https://github.com/wwwlicious/R4MVC/blob/master/src/R4Mvc/R4MVCCompilerModule.cs#L38
https://github.com/wwwlicious/R4MVC/blob/master/src/R4Mvc/Ioc/IocConfig.cs
The text was updated successfully, but these errors were encountered: