-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExpressionHelper contains a compatibility bug with Roslyn compiler #117
Comments
@dougbu, can you please look into this? |
Thanks for contacting us. One of our team members will look into it and get back to you. |
tl;dr backporting the fixes from this commit in ASP.NET Core MVC should resolve the issue. |
@mkArtakMSFT Any new progress on this issue? |
@dougbu, did you get a chance to look into this? |
@mkArtakMSFT I read the comments over the weekend and no longer think we need an investigation. We fixed a related problem in ASP.NET Core and can do something similar here. That should fix the problem. Should however spend some time adding a number of tests covering more-complicated lambda expressions in this repo. BTW, I'm surprised Roslyn versions are material here: I would expect the set of captured local variables to remain fairly consistent. |
- #117 - see also aspnet/Mvc@a045324d3a and PR aspnet/Mvc#3027, the fix for aspnet/Mvc#2890 nits: copy some improved comments from aspnet/Mvc@a045324d3a
There is a bug in the ASP.NET MVC 5.2.3 for a long time. It's hard to explain this in English. So I made a few steps to reproduce this problem.
STEPS TO REPRODUCE THE PROBLEM
https://gist.github.com/doggy8088/58dd3c773ef9877155b19ebb2fda8525
As you can see, the
@Html.TextBoxFor(m => data[i].Name)
generated field name in the for-loop in the view are all wrong.MORE INFO
This problem is only exists when ASP.NET MVC 5 project using Roslyn to compiler views.
I was wrote an article about 2 years ago. My article is written in Chinse. If some of you can read Chinese, you can also reference my article over here: https://blog.miniasp.com/post/2016/03/06/ASPNET-MVC-5-View-Roslyn-problem-workaround.aspx
I actually proposed a pull request to fix this problem about 2 years ago too. You may check it out too.
The text was updated successfully, but these errors were encountered: