msawczyn / EFDesigner

Entity Framework visual design surface and code-first code generation for EF6, Core and beyond
MIT License
363 stars 60 forks source link

Designer not shown #292

Closed giancarlomelis closed 3 years ago

giancarlomelis commented 3 years ago

Hello! After creating the .efmodel file and open it, Visual Studio shows the xml content, but not the designer:

issue_pic

Microsoft Visual Studio Community 2019 Version 16.10.0

What can I do?

msawczyn commented 3 years ago

One other user reported this issue, and it appears to be a problem between the designer and some other extension that you may have installed. Could you please post a copy of your Visual Studio log file? That may give a clue as to what's happening.

giancarlomelis commented 3 years ago

Thank you. Which log would you like specifically?

msawczyn commented 3 years ago

I'm after the IDE's log (https://docs.microsoft.com/en-us/visualstudio/ide/reference/log-devenv-exe?view=vs-2019). If you haven't ever created one of those, it can be quite long. 🤕

giancarlomelis commented 3 years ago

Hi. I've attached a log

VSLog.log

giancarlomelis commented 3 years ago

maybe is this the point?

`

2979
<time>2021/05/31 15:39:25.515</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [EFModelPackage]Source: &apos;System.ComponentModel.Composition&apos; Description: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.&#x000D;&#x000A;&#x000D;&#x000A;1) No exports were found that match the constraint: &#x000A;&#x0009;ContractName&#x0009;Microsoft.VisualStudio.Modeling.ExtensionEnablement.IExtensibilityLogger&#x000A;&#x0009;RequiredTypeIdentity&#x0009;Microsoft.VisualStudio.Modeling.ExtensionEnablement.IExtensibilityLogger&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot set import &apos;Microsoft.VisualStudio.Modeling.Shell.ExtensionEnablement.CommandExtensionRegistrar.mefImportedLogger (ContractName=&quot;Microsoft.VisualStudio.Modeling.ExtensionEnablement.IExtensibilityLogger&quot;)&apos; on part &apos;Sawczyn.EFDesigner.EFModel.ExtensionEnablement.EFModelCommandExtensionRegistrar&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.Modeling.Shell.ExtensionEnablement.CommandExtensionRegistrar.mefImportedLogger (ContractName=&quot;Microsoft.VisualStudio.Modeling.ExtensionEnablement.IExtensibilityLogger&quot;) --&gt;  Sawczyn.EFDesigner.EFModel.ExtensionEnablement.EFModelCommandExtensionRegistrar&#x000D;&#x000A;&#x000D;&#x000A;</description>
<guid>{56BBE1BA-AAEE-4883-848F-E3C8656F8DB2}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>

2980 Error VisualStudio SetSite failed for package [EFModelPackage](null) {56BBE1BA-AAEE-4883-848F-E3C8656F8DB2}
80131500
2981 Error VisualStudio End package load [EFModelPackage] {56BBE1BA-AAEE-4883-848F-E3C8656F8DB2}
80131500

`

msawczyn commented 3 years ago

Thanks for providing that; it gave a lot of good information.

It appears the error is stemming from the MEF (meta-extensibility framework) subsystem in Visual Studio. I did some searching for those kinds of errors and they appear sporadically in reports for various MEF-enabled extensions, even for shipping parts of Visual Studio that are MEF-based (note that the designer contains MEF hooks in it).

There are a number of different solutions that have been given, from repairing Visual Studio and rebooting, to waiting for an update. It appears to be very hit-and-miss as to what fixes it at any given time, which tells me there are different root causes for the same behavior.

I'd suggest starting with clearing the MEF component cache. Mads has an extension that can help with that, or you can do it manually (info on that is on the Marketplace page linked above. If that doesn't work, you may have to do a repair, but that's a fairly long process so I wouldn't go there first.

giancarlomelis commented 3 years ago

Hello. Thanks for the reply. Unfortunately neither solution worked. Even after Visual Studio restore the model is not shown. Unfortunately I think I will have to give up.

msawczyn commented 3 years ago

Understandable. Thanks for trying, and I'm sorry I couldn't have been more help.