razor: RZ10020 error after upgrading to Visual Studio 17.6
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
After upgrading to Visual Studio 17.6, with dotnet 7 SDK at 7.0.302, we are seeing the following Razor errors when using @bind-Value:get
RZ10020 Attribute 'bind-Value:get' can only be used with RazorLanguageVersion 7.0 or higher
Expected Behavior
No errors reported.
Steps To Reproduce
No response
Exceptions (if any)
RZ10020 Attribute ‘bind-Value:get’ can only be used with RazorLanguageVersion 7.0 or higher
.NET Version
7.0.302
Anything else?
No response
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 15 (2 by maintainers)
Issue still present in the new 17.7 GA release. 😞
This issue remains in VS 17.6.4.
In a new Blazor Server project, replace index.razor with this code. The error list indicates 6 errors, however the project still runs.
I updated to VS 17.6.3 and .NET 7.0.304, but this issue still remains. Was this intended to be fixed in those updates?
Set the following in your .csproj, wait VS to register the change, then delete it:
Resolved it for me, without restarting etc. Just after saving the
csproj, an open .razor window flashed, and the errors cleared. Had already cleaned the solution, nixed bin/obj/.vs, to no avail.I still cannot reproduce the issue, either, so this does appear to be a bug.
This has been fixed in subsequent updates.
I have same issue in 17.7.6. There was no errors when I wrote soemthing like
@bind-Value:get="something"at first. But when I opened my computer next week the RZ10020 errors just came from nowhere.🤨The project runs normally though.
@ryanbuening as @blake-fm said, the bind after stuff not being colourized is known, and tracked by https://github.com/dotnet/razor/issues/8552
@ryanbuening
@bind:afterwas already behaving that way for us, prior to the kerfuffle in May.Those two use
CreateInferredEventCallback, which is… creative. Speculation: it may need its own special context to handle semantics.I am getting this bug as well after upgrade and a completely new project (created after the upgrade)
Same
I get this error too, although only in the editor. I don’t see it in build output