1

Closed

Designer: Multiple asserts while opening solution with already opened EDMX

description

Note that this does not repro in VS 2012. When opening a solution that contains a project that contains and EDMX that was left open in the EF designer last time, you get multiple asserts in the debug version of the designer. The message on all of the look similar to this:

Running Document Table does not contain document in GetXmlModel() at...

After ignoring all the asserts (tens for a very simple model) the designer seems to be working correctly.

If the EDMX file is opened after the project is completely loaded the issue does not repro.

We should investigate the reason we are hitting this assert and decide whether we want to remove it or if we need to change anything else.
Closed Aug 2, 2013 at 1:46 AM by maumar
Verified, closing

comments

moozzyk wrote Jul 17, 2013 at 12:25 AM

This seems to be caused a change/regression in VS2013. Before VsShellUtils.IsDocumentOpen would return true when the document has been loaded even though the solution has not finished loading now VsShellUtils.IsDocumentOpen returns false if the solution is still being loaded. I started a thread on this internally but we if needed we can workaround this by skipping the checks when the solution is being loaded. Note that the checks that fail are all inside a DEBUG block and they don't change the state/variables used for normal execution (i.e. the execution continues the same way whether the checks fail or pass).

moozzyk wrote Jul 17, 2013 at 7:02 PM

The change to VsShellUtils.IsDocumentOpen was intentional to support one of the new features in VS2013.

moozzyk wrote Jul 17, 2013 at 7:04 PM

Fixed with changeset #d474870 in the designer repo

ForDiegoWithLove - fixing a problem with Diego's machines

Diego tends to leave open edmx files when closing VS and then complains he is unproductive because of a few Asserts (just one assert for each Xml element in the model being opened) he has to dismiss. The asserts are caused by a change in the behavior of one of the VS Shell dlls which used to return true when a document was opened but the solution has not finished loading and now is returning false until the solution is fully loaded. Fixing this will allow Diego to take care of all EF6 High and Med bugs by Friday with the exception of https://entityframework.codeplex.com/workitem/1163 which now can be punted for EF6.