none
Simple query returns strange results RRS feed

  • Question

  • MVC 5 application. This was working, but suddenly stopped. EF 6.1.1 Code First.

    A simple query to get all rows from a table: context.ProductSeasons.

    This should return multiple rows, but when I look at this in the debugger, I get "Could not evaluate expression" for every row.

    I tried context.ProductSeasons.ToList() to see if it was something with delayed execution. Same result.

    When I query the table in SSMS, I get the correct result back.

    This is the only table this happens on.

    I have rebooted my PC and cleaned the bin folder and rebuilt.

    Not sure what to look at here. An suggestions?


    Craig Berntson
    MCSD, Visual C# MVP
    INETA Community Speaker
    www.craigberntson.com

    Wednesday, September 10, 2014 9:17 PM

All replies

  • Hello Craig Berntson,

    >>Not sure what to look at here. An suggestions?

    Being not sure if it is an issue caused by the Entity Framework 6.1.1, I would suggest that you could try to do a test with other version Entity Framework as 6.0.0 and 5.0.0 to narrow down this issue.

    If with other versions, it could work as expected, this should be caused by the newest version, please share your related entity class with us as ProductSeasons so that we could test it to see if this behavior would happen on my computer and find the caused reason.

    If with other versions, it still has the same result, then I think this issue may be related with the new debug engine in VS 2013, it is submitted by Eivind in the first comment of this blog,  and there is a fix for the issue in Update 2 CTP 2:

    http://www.microsoft.com/en-us/download/details.aspx?id=43721

    You could have a try.

    Best Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Thursday, September 11, 2014 1:42 AM
    Moderator
  • Fred,

    I'm running VS 2013 update 2. But why would this affect only one entity? From what I can tell, all other queries are working correctly.

    Here's the entity code

    public class ProductSeason
       {
           public int Id { getset; }
           public int ProductId { getset; }
           public string Season { getset; }
     
           virtual public Product Product { getset; }
       }


    Craig Berntson
    MCSD, Visual C# MVP
    INETA Community Speaker
    www.craigberntson.com

    Thursday, September 11, 2014 3:16 PM
  • Hello Craig,

    Thanks for providing the entity class. I am trying to reproduce this issue with the class, however, it seems that update 2 is not available and it provides only the update 3. After installing the update 3, I made a test with the same project, the result is that the project works as before.

    With the test, actually, we cannot know if this issue is caused by the Entity Framework 6.1.1 or it is caused by the Visio Studio.

    As I mentioned in my original post, to narrow this issue, I would suggest that you try with EF 5 and EF 6.0.0 as well. And since the update 3 is available, you could also try it to check if it works for you.

    Best Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 12, 2014 6:42 AM
    Moderator
  • Installing VS 2013 Update 3 had no effect, as I thought would be the case.

    I can't go back to an older version of EF because the app used ASP.Net Identity 2.01 that depends on EF 6.1.1.

    This issue has a high visibility project at a dead stop.


    Craig Berntson
    MCSD, Visual C# MVP
    INETA Community Speaker
    www.craigberntson.com

    Monday, September 15, 2014 10:24 PM
  • Hello Craig,

    >>I can't go back to an older version of EF because the app used ASP.Net Identity 2.0.1 that depends on EF 6.1.1.

    From your description, I am wondering if this is due to the ASP.NET Identity API because with the single Entity Framework 6.1.1 demo, it works correctly.

    If you use a separate context class(not the automatically generated by the ASP.NET Identity API) for your business entities, for narrowing down this issue, I would suggest that you could create an sample application as a console application and copy the whole business model and test it under Entity Framework 6.1.1 to see if it works.

    And recently the team has release a new version ASP.NET Identity 2.1.0, you could also try with it.

    If this still does not work for you, I would suggest that you could open a bug on https://connect.microsoft.com/visualstudio

    and attach your solution and repro steps as well.

    Best Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, September 16, 2014 7:22 AM
    Moderator
  • Seems the issue was with the virtual public Product property. There was an issue with Product that was causing the error. This has been resolved.

    Craig Berntson
    MCSD, Visual C# MVP
    INETA Community Speaker
    www.craigberntson.com

    Thursday, January 29, 2015 4:08 PM