{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/4418","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/4418/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/4418/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/4418/events","html_url":"https://github.com/aspnet/Mvc/issues/4418","id":146352569,"number":4418,"title":"Inject custom taghelpers in Html.Raw()","user":{"login":"pierre-weceipt","id":6052793,"avatar_url":"https://avatars.githubusercontent.com/u/6052793?v=3","gravatar_id":"","url":"https://api.github.com/users/pierre-weceipt","html_url":"https://github.com/pierre-weceipt","followers_url":"https://api.github.com/users/pierre-weceipt/followers","following_url":"https://api.github.com/users/pierre-weceipt/following{/other_user}","gists_url":"https://api.github.com/users/pierre-weceipt/gists{/gist_id}","starred_url":"https://api.github.com/users/pierre-weceipt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierre-weceipt/subscriptions","organizations_url":"https://api.github.com/users/pierre-weceipt/orgs","repos_url":"https://api.github.com/users/pierre-weceipt/repos","events_url":"https://api.github.com/users/pierre-weceipt/events{/privacy}","received_events_url":"https://api.github.com/users/pierre-weceipt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-04-06T15:35:16Z","updated_at":"2016-04-11T17:38:34Z","closed_at":null,"body":"Hi, I'm wondering if we can inject some new MVC and custom taghelpers in the razzor view with `@Html.raw()` and have them processed?"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/208467347","html_url":"https://github.com/aspnet/Mvc/issues/4418#issuecomment-208467347","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/4418","id":208467347,"user":{"login":"NTaylorMullen","id":2008729,"avatar_url":"https://avatars.githubusercontent.com/u/2008729?v=3","gravatar_id":"","url":"https://api.github.com/users/NTaylorMullen","html_url":"https://github.com/NTaylorMullen","followers_url":"https://api.github.com/users/NTaylorMullen/followers","following_url":"https://api.github.com/users/NTaylorMullen/following{/other_user}","gists_url":"https://api.github.com/users/NTaylorMullen/gists{/gist_id}","starred_url":"https://api.github.com/users/NTaylorMullen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NTaylorMullen/subscriptions","organizations_url":"https://api.github.com/users/NTaylorMullen/orgs","repos_url":"https://api.github.com/users/NTaylorMullen/repos","events_url":"https://api.github.com/users/NTaylorMullen/events{/privacy}","received_events_url":"https://api.github.com/users/NTaylorMullen/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T17:38:34Z","updated_at":"2016-04-11T17:38:34Z","body":"@pierre-weceipt we currently do not have any \"nice\" way to perform dynamic TagHelperification of output. `TagHelper`s are typically a compile time feature. If you'd like to build snippets and pass them to views I'd recommend throwing that HTML content into a partial, that way you'll be able to get all the `TagHelper` greatness.\r\n\r\nIf you absolutely must have a string that you then want to activate `TagHelper`s in you could run that string through the [MvcRazorHost as its own content stream](https://github.com/aspnet/Mvc/blob/dfe35bbef7211df567b26ce2a5b4a12e039226b9/src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcRazorHost.cs#L260-L265) and then running the compiled content through the [DefaultRoslynCompilationService](https://github.com/aspnet/Mvc/blob/dfe35bbef7211df567b26ce2a5b4a12e039226b9/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRoslynCompilationService.cs#L90). Both of which can be accessed from DI via [IMvcRazorHost](https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Razor.Host/IMvcRazorHost.cs) and [ICompilationService](https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Razor/Compilation/ICompilationService.cs). I do want to warn that this approach does not perform well."}}