EntityFramework 5 - Getting value cannot be null parameter name: font error while using the designer - entity-framework

I'm getting a strange error while using EF 5 using a Database First approach on the designer. The error is saying 'value cannot be null parameter name: font'. I also get a big red X over the design area. I'm not exactly sure how the designer generated this error, and to this point, I've only used the designer to create my edmx.
Thoughts? This is with VS 2012 RTM version.

I was able to resolve the same error by simply restarting Visual Studio.

I was able to fix this by repairing the Entity Framework Designer for Visual Studio 2012 (Control Panel -> Uninstall a program etc..)

I just had exactly the same problem (several years later) after I started using Entity Framework designer right after installing it. (using VS2019, .NET Framework 4.7.2, and Entity Framework 6)
I the issue disappeared, before I could document it:
Restarting Visual Studio only one time was not enough; I did it few times.
I'm not sure why, but it is likely because that some VS components did not unload right away when I was just restarting it.
I guest it would have work right away by restarting the computer, to ensure everything is unloaded from memory.
Thanks to SausageFingers for the clue.

Related

Visual Studio Ultimate 2013 crashes when using Entity Framework Power Tools Beta 4

I'm running VS Ultimate 2013 on a Windows 8.1 machine and have been successfully for several months now. However, I just installed the NuGet package for Entity Framework Power Tools Beta 4 today and am having issues. After installing EFPT, I restarted VS, loaded my solution, made my "data" project the startup project, right-clicked on my class deriving from DbContext -> Entity Framework -> Generate Views. Visual Studio completely crashes and restarts. I've tried clicking on other options in in the EFPT context menu such as "View Entity Data Model (read-only)" and all of them results in VS completely crashing and restarting.
I was running VS with Update 3, so I installed Update 4 and still the same issue. It does NOT crash if running devenv.exe in safemode, but EFPT doesn't actually DO anything either.
So now, I'm running VS version 12.0.31101.00 Update 4 with .NET Fx 4.5.51641 and Entity Framework 6.1.2.
Ultimately, I'm trying to create a EDM mapping file for my code-first EF context to cache and reduce startup time. If this issue I'm having is a known issue, is there a fix OR a workaround in generating this mapping???
Thank you Erik. I wanted to answer my own question because I was able to take it a step further. Rather than writing (a LOT) of code to generate cached views and having to run it every time your code changes.
A dev on the SignalR team at Microsoft, Pawel Kadluczka, wrote a nice and EASY-TO-USE bit of code that can be installed via NuGet. The "Interactive Pre-Generated Views" project, when added to your data assembly, will look for cached views and if not found, generate them on the fly. Out of the box, it supports both file and db cached view info.
The only bit of code I had to add to utilize this was:
static DynamicDbContext()
{
InteractiveViews.SetViewCacheFactory(new DynamicDbContext(), new FileViewCacheFactory(_SCRIPT_DIRECTORY + "dbviews.xml"));
}
It literally took me 5 minutes to install, write the bit of code, execute and confirm.
It needs to run prior to any query being executed with your dbcontext and so he recommends this bit of code to be placed in a static ctor of your custom dbContext.
Pawel's blog post where he describes it is: http://blog.3d-logic.com/2013/12/14/using-pre-generated-views-without-having-to-pre-generate-views-ef6/
You can install via NuGet or read more about it on CodePlex: https://efinteractiveviews.codeplex.com/

I can't open .EDMX files in the Entity Data Model designer

I can't find the ADO.NET Entity Data Model in Visual Studio 2012. When I open EDMX it opens in XML only not in designer. When trying to add new item to a project I don't find ADO.NET under Data tab.
I tried almost all solutions proposed on the net but no result:
I removed EF5 and installed EF 6.2 but the problem persist.
I tried to install VS2012 Updates but no change.
Repairing current install no change.
I tried to find ADONETEntityFrameworkTools_enu.msi in the install media but can't find it. -
I tried all other solutions but not working.
I've figured out the problem : when i run ETool.msi from Install Media for repair,
it was an older ver. (EF.4) than the currently installed ver. (EF.6) so it wasn't working.
So i downloaded EFTool ver.6 (same ver. of installed EF) ,run Repair command and it fixed the problem
I had the same problem but perhaps in reverse. I uninstalled VS 2012, reinstalled and when I opened up my v4 EF model it opened in XML rather than the designer.
I uninstalled the EF Designer for VS from the Control Panel, ran EFTools.msi from the installation media and everything was fine.
Perhaps a version compatibility issue like Hussein's.
you should add both EntityFrameWork.dll and EntityFrameWork.SqlServer.dll to your project

Entity Framework Power Tools error when using Reverse Engineer Code First

I have a Sql Server 2012 database that I am trying to generate the Code First POCOs/Mappings in Visual Studio 2012 SP1 using the Reverse Engineer Code First option of EF Power Tools 2.
After setting the connection properties, the following error is generated. I have researched the web but with no luck on how to resolve this. Any help would be appreciated.
Compiling transformation: The type or namespace name
'EfTextTemplateHost' could not be found (are you missing a using
directive or an assembly reference?)
EDIT:
EF Power Tools Beta 3 shipped today and the issue should be now fixed
You will see this exception if you try using EF Power Tools after installing VS 2012 Update1. Rowan's response on EF Team blog (in the comments, towards the bottom of the page) reads:
As a workaround to this issue you can edit Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF.Utility.CS.ttinclude and remove the first line (<## CleanupBehavior Processor="T4VSHost" CleanupAfterProcessingTemplate="true" #>).
The only side effect of doing this is that the EF Designer will use more virtual memory when you create and edit models. On most computers this isn't a problem.
We are working on shipping a new version of EF Power Tools which will include a fix for this problem.
EDIT:
Rowan's blog contains more details on how to manually work around the issue if you still hitting it even though you have Power Tools Beta 3 installed.
Try to use this plugin
https://skydrive.live.com/?cid=456117cf53a42144&id=456117CF53A42144%21388
(however it's not signed)
Someone complained # MSDN that Power tools is screwed (actually whole EF is a mess).
After you install this one, when VS prompts you for database information click on "Advanced" and set Persist Security Info to True.
Should work
EF still got a crapload of bugs, avoid using it for critical environments. Don't even think about EF5.

How to remove EF 4.2 and reset my Visual studio

I installed a lot of ado.net entity framework versions and tools. one of them was this one: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=26660
Now there are a lot of problems while trying to add a new entity data model, and also can't use any code generation tools such as dbcontext code generator.
What I want to know is how to remove all of these ef versions and reset my Visual studio 10.
Note, I repaired my vs, and reinstalled the SP1 but with no hope, the same errors are there.
here are 2 screen shots that may let you help me better:
installed items in my VS:
error appear after trying to add a new entity data model:
The uninstallation procedure of EF June 2011 CTP is described in this article. As you see in your linked download page there is red text in instructions describing issues with CTP. That CTP should have never been installed on your main development (production) machine because it breaks existing VS functionalities. The instructions directly says that it should be installed in non-production environment (for example virtual machine).

Issues with the new Entity Framework (June 2011 CTP causing unknown errors)

So I installed Entity Framework June CTP day before and all was fine until I went to add POCO's to the EF, that's when I got this error
So I thought to myself 'It must have been the CTP that's causing this, so I went and unloaded it. I restarted Visual Studio and was greeted with this message:
I hit No and Visual Studio finished loading my project. When I once again tried to add the POCO's I was greeted with this error:
So does anyone know what's going on and how I can resolve this issue? I know Entity Framework 4.2 has new items but for the time being I prefer the POCO way of doing things.
EF CTP 2011 is very first preview of EF 4.2. It also shows only subset of features expected in EF 4.2. First of all it is not for developing production code and it should not be installed on the machine where you write a production EF code.
It is expected that CTP can contain bugs - that is why CTPs are published - to collect feedback and find bugs. It is not clear what you actually did to get the error but if you have a technical problem with CTP ask on EF pre-release forum for help.
Why not simply remove EF 4.2 ? Removal guide here: http://blogs.msdn.com/b/adonet/archive/2011/06/30/announcing-the-microsoft-entity-framework-june-2011-ctp.aspx
I had exactly same problem and resolved it by uninstalling "SQL Server Tools for Data Framework June 2011 CTP" - download it at http://www.microsoft.com/download/en/details.aspx?id=26660, run and select the Remove option.
After that I was able to recover the Entity Framework tools to SP1 state using the steps in Uninstall section described at
http://blogs.msdn.com/b/adonet/archive/2011/06/30/announcing-the-microsoft-entity-framework-june-2011-ctp.aspx.