Reporter |
|
---|---|
Created | Apr 6, 2018 7:16:27 PM |
Updated | Apr 11, 2018 12:03:16 AM |
Resolved | Apr 10, 2018 2:46:56 PM |
Subsystem | ASP.NET - Razor |
Assignee | Slava Trenogin (derigel) |
Priority | Show-stopper |
State | Fixed |
Type | Bug |
Fix version | 2018.1 |
Affected versions | No Affected versions |
Fixed In Version ReSharper | 2018.1 EAP 8 |
VsVersion | All Versions |
Given code like the following:
<label asp-for="@Model.Name"></label>
Rider is marking the @Model property and saying "Cannot resolve symbol 'Model'". The example code is taken from https://docs.microsoft.com/en-us/aspnet/core/mvc/views/working-with-forms so it should be valid markup. It also seems to be a regression because Rider 2017.3 didn't have problems with it (although it's hard to tell for sure because 2017.3 would mark lots of Razor/.cshtml files with errors until you editted them and it reparsed).
I'm having other problems related to Roslyn in the 2018.1 EAP as well so I'm not sure if this issue is predicated on the other one or if it's independent.
I generally use @Html.EditorFor() syntax but some colleagues use the asp-for attribute and I'd prefer not to have to change their working code to appease Rider. A warning would be fine. Auto-fix to/from the static types would be pretty cool but low priority.
Thanks.
Version: 181.4379.538
Timezone: America/Chicago
Evaluation: true
Environment: RD-181.4379.538, JRE 1.8.0_152-release-1136-b23x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.13.3 unknown, screens 1440x900, 1920x1200