aspnet / RazorTooling

Razor tooling for Visual Studio 2015

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TagHelpers documentation is not loaded if project is a part of a solution

IlyaKhD opened this issue · comments

If TagHelpers lib is a part of a solution its documentation file (that is required to build DocumentationDescriptor for the Intellisense) is not loaded.

See the CreateDocumentationDescriptor method of the TagHelperDesignTimeDescriptorFactory

The thing is that documentation file location is determined by the Assembly.CodeBase prop (Assembly.Location was null while I was debugging).

Try the LoadDocumentation app in this branch.

Run the following command:
> dnx resolve-feed
DesignTimeDescriptor is successfully created for property. Note Assembly.CodeBase (printed at the top of the output from the AssemblyLoadContextTagHelperTypeResolver.GetExportedTypes method) is correct.

Then run this:
> dnx resolve-sources
Property DesignTimeDescriptor is not created and assembly.CodeBase is wrong and points to %userprofile%/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-final/bin/Microsoft.Dnx.Loader.dll.

The problem seems to be connected with the Microsoft.Dnx.Host.LoaderContainer calls.

@IlyaKhD yup, this is currently by design. When in VisualStudio the assemblies loaded are in memory when they correspond to a user project. Due to this, their corresponding XML files aren't written out. They're managed by something called the design time host (DTH) which is used to enable the VisualStudio experience.

If we wanted to add user project consumption with how the DTH works today we'd have to utilize Roslyn to manually pick through user TagHelpers. We decided it'd be too much work for too little gain since the 90% use case for TagHelper documentation exists when consuming nugget packages (which have the XML file used to determine descriptive intellisense).

Thanks, it is now clear for me.