Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

VS reports Invaliud tag helper property even though now supported #1444

Closed
deap82 opened this issue Jun 16, 2017 · 6 comments
Closed

VS reports Invaliud tag helper property even though now supported #1444

deap82 opened this issue Jun 16, 2017 · 6 comments

Comments

@deap82
Copy link

deap82 commented Jun 16, 2017

I have created a TagHelper that has a property of type IDictionary<string, ModelExpression>

According to this GH Issue, it was originally not supported, but now it should be: aspnet/Mvc#5310

And my TagHelper is working as expected.

But if I build my project when a view file (*.cshtml) that uses this tag helper is open in VS. I get the following output in VS Error List: Error Invalid tag helper property 'SomeNamespace.SomeTagHelper.some-prefix'. Dictionary values must not be of type 'Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression'.

Could it be that the support for properties of type IDictionary<string, ModelExpression> in TagHelpers also requires some update to VS 2017 in order to not get this error message? Currently It's a bit confusing, especially for fellow developers that might not have insight into this.

vs-error

This issue is also posted here:
https://developercommunity.visualstudio.com/content/problem/66937/vs-reports-invaliud-tag-helper-property-even-thoug.html

@NTaylorMullen
Copy link
Contributor

@ajaybhargavb could you investigate this guy?

@ajaybhargavb
Copy link
Contributor

@deap82, I tried to reproduce your issue but couldn't. Which version of Razor/Mvc are you using? If possible, could you share a sample repro app?

@deap82
Copy link
Author

deap82 commented Jun 20, 2017

@ajaybhargavb I'm on an asp.net core mvc app, not sure what kind of version definition (number) you are asking for. Could you perhaps start with sharing your repro app and I can quickly see if I get the error in my environment?

@ajaybhargavb
Copy link
Contributor

I meant the versions you are referencing in your csproj. (If you right-click your project -> Edit MyProject.csproj)

@deap82
Copy link
Author

deap82 commented Jun 20, 2017

Version 1.1.1 for Microsoft.AspNetCore.Mvc.Core, Microsoft.AspNetCore.Mvc and Microsoft.AspNetCore.Mvc.Razor.

@ajaybhargavb
Copy link
Contributor

@deap82, I tried reproducing with a 1.1 app but still couldn't. Here is the app that I used https://github.com/ajaybhargavb/TestApp/tree/master/WebApplication1. The VS version I used was 15.2 (26430.14) Release. I am closing this issue for now but feel free to re-open the issue if you are still seeing the issue even after updating Visual Studio.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants