Closed thomas-heath closed 2 years ago
My mistake, I believe in making this issue that I stumbled upon the cause. The compiler automatically applies the contents of _Imports.razor to every razor file in its directory and sub-directories, so every component in the project was injecting localizer.
OK glad you found the cause! Yes the library has no dependency on a localizer.
When trying to use this library to make html from a component I get this error:![image](https://user-images.githubusercontent.com/15156791/150329018-3a7664d3-4962-48cb-93eb-12c940973eff.png)
It pops up when calling Render, here's the code for the rendering and the component:
![image](https://user-images.githubusercontent.com/15156791/150329240-46b1e7b5-2227-4215-b7d6-ed937a432c7b.png)
I've gotten rid of the error by adding Localizer as a service, but that begs the question as to why that component is trying to use Localizer in the first place?
My first theory was that it was using the MainLayout, but that doesn't contain any reference to Localizer. The only other place I can think of that it would be requesting this service is in _Imports.razor, but why would this component be pulling from there?