aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

TagHelpers not highlighted?

Open chassq opened this issue 10 years ago • 16 comments

HEy All,

When I fire up a new web application project for ASP NET Core 1 none of the Tag helpers seem to light up and I do not get intellisense in my tags for asp-. Any ides on how to get that back? For example adding an asp-for to a div tag does not turn the asp-for the purple color it was I think in RC1.

chassq avatar May 19 '16 16:05 chassq

@chassq Have you built the project? That's currently a requirement for TagHelper IntelliSense.

NTaylorMullen avatar May 19 '16 16:05 NTaylorMullen

Same issue on my side

ghost avatar May 20 '16 19:05 ghost

@Pictuel for a new web application unchanged?

NTaylorMullen avatar May 20 '16 19:05 NTaylorMullen

I actually can see the highlighting and intellisense on a new project but on an upgraded project from RC1 I do not see the highlighting.

chassq avatar May 20 '16 19:05 chassq

no, my application is a port from rc1, taghelpers seems to works fine when the app is running but are not higlighted nor intellisensed on vs

ghost avatar May 20 '16 19:05 ghost

For an upgraded app you need to ensure the following: https://github.com/aspnet/Tooling/issues/484#issuecomment-219807702

NTaylorMullen avatar May 20 '16 19:05 NTaylorMullen

still nothing for me, everything was set as you said except for:

"Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-*" },

ghost avatar May 20 '16 19:05 ghost

@Pictuel what dotnet are you using and what version of Microsoft.NETCore.App is being resolved?

  • Can find out the dotnet version by typing dotnet --info in the package manager console window in Visual Studio.
  • Cna find out the Microsoft.NETCore.App version by looking in your project.lock.json file.

NTaylorMullen avatar May 20 '16 19:05 NTaylorMullen

my dotnet -v is 1.0.0-preview1-002702 (this is the version also set in my global.json)

and Microsoft.NETCore.App seems to be 1.0.0-rc2-3002702 (now set in project.json)

ghost avatar May 20 '16 19:05 ghost

These entries look correct in my project.

chassq avatar May 20 '16 20:05 chassq

Could both of you push a minimal repro to GitHub so I could take a look?

NTaylorMullen avatar May 20 '16 22:05 NTaylorMullen

Hey, paired down a simple web site I had converted from RC1 to RC2. See attached zip file. You should see the issue if you navigate to the Views->Account-Login.cshtml file. At least when I open it the tag helpers are not highlighted nor do I get intellisense for asp-* attributes. Hope this helps!

PS Took out bower and node module folders so it will have to restore them. SampleWebSite.zip

chassq avatar May 21 '16 08:05 chassq

I'm afraid I don't have any project to share.

ghost avatar May 21 '16 10:05 ghost

Somehow mine is highlighted now, probably a reboot made it work again, weird.

ghost avatar May 23 '16 01:05 ghost

@chassq So I looked at your project and it seems your issue is tied to this bug which I have a PR out for.

Ultimately, to fix your issue change your @addTagHelper statements to be unquoted.

Aka @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

NTaylorMullen avatar May 23 '16 19:05 NTaylorMullen

Yep, that did the trick!! Thanks!!

chassq avatar May 23 '16 19:05 chassq