-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Feature Request/Question: Ability to easily author/inject new directives for Razor? #37302
Comments
From @rynowak on March 25, 2018 23:47 We plan on enabling this kind of thing once we have support for it in tooling. While it would be possible for us to provide support for this in the runtime/compiler right now, the tools would not understand the new directives and would produce errors. |
@rynowak, do we have a separate issue tracking this work, or should we use this one for tracking? |
From @rynowak on March 26, 2018 18:7 We don't have an issue for it, but its on our roadmap and planning documents. If you're deeply passionate about having an issue for it, then Razor repo is the right place to track. |
Guys sorry this ended up here. All I was asking for was a way to inject directives for a razor view engine via kestrel. Somehow this got turned into a tooling cluster fuck. Not what I meant. |
That's the answer though. This is not easily possible today, we plan to make it work in the future, but only when it will work end to end. |
Ok first of all, I totally respect your team and thanks for designing this product so well that I could inject new directives. Seriously job well done team. Your design is spot on keep it going ... ** Warning crazy long ass rant with expletives about the fucking mentalists in the aspnet team. ** Why am I asking for this so soon?BackgroundI have joined the castle project as an OSS contributor. We might all think they are "passed due" but unfortunately the fact is they invented the first IoC container for dotnet. They also had some really gifted developers which evolved their envisioning of what module inversion would look like today(sic: https://en.wikipedia.org/wiki/Inversion_of_control). IoC containers now are a dime a dozen. Windsor was first period, they learnt all of these problems a long time ago. Crazy drugged up, drunken mother f%#king David Fowler invented Microsoft.Extensions.DependencyInjection.Abstractions. This made some really bold assumptions about how containers work today. It completely ignored the framework offering of the disposable pattern and augmented scoped behaviour with a god damn service locator pattern. F%#king rubbish really considering it earned us(Castle) the title of non-conforming container. If you think service location is bad please ask Ploeh. The pointThe only reason I am asking for this feature via kestrel is because I believe I need to write a new @Inject directive based on this experimental PR which led to this failed PR. Your work here is only expedited by the failings of aspnet/Mvc#5403. ConclusionPlease take your time on this one. You guys are doing a great job, I am unfortunately trying to work round what the aspnet d1ckh3ds gave us to work with. No rush. Again this is not what I meant. |
#IWillNotLetThisGoUntilYouFixIt |
As I understand, however correct me if I am wrong, but Autofac had to rewrite there own service collector to get this to work, and simpleinjector use cross wiring of sorts to get thins to work. I have also seen a Ninject example that cross wires. Hence, I believe “Huston, We have a problem”. |
Can you please post examples of this? I know of one place where you can see how many IoC containers are cut out by this please see link below:
F%#king shocking. This is disgusting and devalues my opinion of Microsoft today. |
IoC library developers all over the place I crawling up their own ass to make this work. I wish people at Microsoft could see the pain they caused. |
You lot are villain, not community driven. A complete violation of OSS. |
Thanks for contacting us. |
@allisonchou compiler ❤️ |
Thanks for contacting us. We don't plan to add extensibility for this area. However, we will still be interested in learning about other scenarios where people may need this, so please feel free to file new issues with those scenarios, if you have any. That will let us to reevaluate our stance here. |
From @Fir3pho3nixx on March 24, 2018 18:58
Currently, I cannot find an easy way to author/inject custom directives into Razor whilst using ASPNET Core Mvc(Kestrel).
I can see that the
@Inject
directive gets registered within razor here. Now if I wanted to inject a custom directive to MVC on startup how would I achieve that easily? Imagining for a second I wanted to create a '@FooInjector'.I can see you offer access to RazorViewEngineOptions is this potentially where you guys would expose something like this?
Copied from original issue: aspnet/Mvc#7540
The text was updated successfully, but these errors were encountered: