I'm not sure if this was intentional but looks like we don't really support namespace directive in component documents. To support this, we'll need to add a ComponentNamespaceDirective similar to ComponentPageDirective.
Although the behavior of this directive isn't any different from regular Mvc/Pages, we can't use the same type because the existing NamespaceDirective resides in Mvc.Razor.Extensions and we can't move it over to Razor.Language because it is not supported in 1.x apps.
Note: This is a prerequisite for supporting namespace directives with usings in https://github.com/aspnet/AspNetCore/issues/5577
cc @rynowak
Could we move it over to Razor.Language but only add it for Razor >= 2.0?
Either way we should support this.
@SteveSandersonMS @mkArtakMSFT @danroth27
We're getting LOTS of feedback about this gap now that components are based on namespaces. We need to do this for preview 6.
Great, let's do it! I see it's labelled XS already.
Is it possible to grab a task like this (or another one) to contribute?
I would love to start some contributions here
@isc30 thanks for your interest in contributing. You can pick any of the tasks that are labelled up-for-grabs https://github.com/aspnet/AspNetCore/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs+label%3Aarea-mvc
Most helpful comment
@SteveSandersonMS @mkArtakMSFT @danroth27
We're getting LOTS of feedback about this gap now that components are based on namespaces. We need to do this for preview 6.