Installing EF Power Tools into VS2015 (with an update for VS2019)

March 2020: In comments below, someone asked about VS2019.

The EF Power Tools Community Edition (see July 2017 note below) still works for VS2019.

Erik EJ also created EF Core Power Tools.

While I’m at it, I thought I would also point out the plain old EF Tools for VS2019. For VS2019 (& IIRC for VS2017), these tools are installed via the Visual Studio Installer.
Entity Framework tools are installed as part of the Data storage and processing workload in the Visual Studio Installer.

You can also install them as an individual component under the SDKs, libraries, and frameworks category.

July 2017: something amazing happened! Erik Ejlskov Jensen, the creator of the SQLCe provider Entity Frameworkas well as the creator of the very popular SQL Server Compact Toolbox extension for Visual Studio, has given us a community version of EF Power Tools for VS2015 and VS2017. Thanks to the tools already being on GitHub, he forked the tools and now we have

EF6 Power Tools Community Edition that you can get via Visual Studio Extensions

Oct 2016 note: There have been over 60,000 hits to this blog post so far. My host is reaping the benefits ($$$). In July, I submitted a pull request to update the VSIX. The PR was finally merged. Now just waiting for the change to show up in the VS Gallery.

TLDR: If you don’t want to do the tasks (even though they are so easy) you can download the updated VSIX I created from here.

The Entity Framework Power Tools extension for Visual Studio has been around for quite some time and is still called a Beta. I cannot live without it’s “View Entity Data Model (Read-Only)” feature which I used to validate my code first models.

But if you try to install the extension into Visual Studio 2015, you won’t find it.

7-25-2015 9-47-12 AM

Checking the extension in Visual Studio Gallery, you’ll see that it hasn’t been updated to install into VS2015.7-25-2015 9-47-49 AM

The fix is nothing more than making it know about VS2015. There are no other compatibility problems that I have experienced. Modifying an extensions installation package (which is just a zip file!) to be aware of another version of Visual Studio is pretty easy. Here are the steps to get the EF Power Tools into VS2015.

Download the extension from the Visual Studio Gallery page.

Find the file

7-25-2015 9-50-13 AM

and change it’s extension to zip.

7-25-2015 9-50-33 AM

Extract the files from the zip file.

7-25-2015 9-53-01 AM

Open the extension.vsixmanifest file in a text editor and find the Supported Products section.

7-25-2015 9-53-25 AM

And copy paste one of the Visual studio elements, changing the version to 14.0. I have the Enterprise version but didn’t bother changing it from Pro here and it didn’t seem to be a problem.

7-25-2015 9-53-47 AM

Now you have to reverse your steps in order to recreate the VSIX file.

Select the files in the extracted folder and zip them. Don’t zip the folder. The files have to be at the root. (Guess how I learned that! Smile ) I named my zip file VSPowerTools15.zip

7-25-2015-9-55-47-AM.png

Rename the file to have the vsix extension.

7-25-2015 9-56-01 AM

Run the file right from here.

7-25-2015 9-56-16 AM

Voila!

7-25-2015 9-56-22 AM

If Visual Studio was open, you’ll have to restart to get this to kick in.

Also you’ll see Entity Framework Power Tools listed in the installed extensions when you look at the About section of Visual Studio 2015.

I accidentally mistook this for something it was NOT and (embarrassingly) tweeted it. I had forgotten that I had done this for the VS2015 preview. Then I installed VS2015 RTM on top of the preview and that picked up all of the installed extensions. When I saw the power tools listed in About, I thought they had a) finally gotten rid of the “Beta” tag and b) installed automatically with VS2015. When I realized the extension was installed, I uninstalled that and indeed the tool went away. So for anyone who saw that tweet…. sorry! Guilty as charged …

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

105 thoughts on “Installing EF Power Tools into VS2015 (with an update for VS2019)

      1. I wish I knew. There have been over 60,000 hits to this blog post and my hosting bill is stupidly high every month because of it. 🙂

          1. haha …yes . My WPEngine hosting bill was pretty crazy for the last year because of this post! 🙂

  1. For some reason, it doesn’t work for me… I’m running VS2015 Community. I tried changing the manifest version to Community but no luck.

  2. I was able to install the power tools and when I right click on the context class and select View Entity Data Model (read only) from the Entity Framework menu VS hangs and the designer never appears. Any ideas?

  3. I Installed the power tools beta 4 on vs2013 but and follow the videos of pluralsight but when i tryed to view the model , i got the following error
    System.IO.FileNotFoundException: Could not find file ‘C:\EF6\NinjaDomain.Classes\NinjaDomain.Classes\App.config’.
    File name: ‘C:\EF6\NinjaDomain.Classes\NinjaDomain.Classes\App.config’
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
    at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
    at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
    at System.Xml.XmlTextReaderImpl.FinishInitUriString()
    at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
    at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
    at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
    at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
    at Microsoft.DbContextPackage.DbContextPackage.GetUserConfig(Project project, String assemblyFullName)
    at Microsoft.DbContextPackage.DbContextPackage.DiscoverUserContextType(Type& systemContextType)

  4. Sorry for taking a little bit away of the topic, but I could not find any info about EF6 Tools. What is the difference between “EF 6 Tools” (separate WIN installation) and “EF Power Tools” (as extension for VS)?

    1. EF Tools is the designer itself. It used to be built directly in to Visual Studio. It will be installed as part of the VS2013 and VS2015 installations though but it is up to you to install updates. The power tools are some extras.

  5. Hello, Julie!
    Thanks for great VSIX package!
    I just wanted to share my little issue and the solution.
    Everything worked great until upgrade MySQL package. Then nasty “Exception has been thrown by the target of an invocation” error message started to appear.
    After debugging the PowerTools (VS with VS) I’ve figured out the problem. My solution is add binding redirection into C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.config file as follow:
    ———————————–

    ———————————————-
    Put your MySql.Data.dll version instead of “6.9.7.0”

    Thanx again!

  6. You are a gem! I would have been crying if it wast for this line:
    “Select the files in the extracted folder and zip them. Don’t zip the folder. The files have to be at the root. (Guess how I learned that! Smile )”

  7. Hello,

    Has anyone had power tools working with Visual Studio 2015 and Entity Framework 7 (core) ? I have installed power tools successfully with this post instructions but keep getting this error when trying to access the read only model from power tools.

    Here’s the error:
    “a constructible type deriving from DbContext could not be found in selected file.”

    1. EF7 is totally different set of APIs from EF6 so the power tools will not work with it. It’s killing me not to be able to validate my models visually yet with EF7 but the team has too much on their plate ATM to even look at that problem. I do know that they have toyed at some point with a way to visualize the models and it is something that they will give us at some point. Maybe someone else is working on a tool as well.

          1. Hi Clinton, I just realized I haven’t gotten notifications in a long time on comments. Sorry. VS2019 is different and I’ve just added a small update at the top of this post! HTH sorry for the delayed reply

    1. except it’s a paid product and a completely different designer. Why shouldn’t we be able to use the Microsoft tool when it’s literally a matter of a tiny edit to the vsix?

  8. Thanks for a good article. I have done everything and i got Installation Complete Window even, but there is no Entity Framework in context menu. My VS 2014 Pro, i restarted vs and comp, no way. Help please!

    1. not deleted…something about it required approving it ..which I have done now.
      But I don’t happen to know what to say to answer your question. Maybe someone else will come along with an answer.

  9. I installed it on Visual Studio 20015 Enterprise, the EntityFramework menu is there, when I click reverse engineer…the connection window comes up and I select the table, but when I click ok after some seconds it is closed without any error and no code is generated!
    any suggestions?

    1. First, keep in mind that there is an improved way to reverse engineer as part of the EF Designer for VS2015 so that you don’t need the power tools for reverse engineer. I use the power tools for the visualization only. There are known issues with the reverse engineer in with VS2015 Update 2. Look for comments around May 2016 on the VS Gallery page for how people have fixed this. (https://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d)

  10. And now I too own the T-Shirt for not zipping up the contents inside the folder…I need to slow down and READ. Thanks Julie!

    1. oh I’m guilty of doing that all the time…skimming and missing important stuff! 🙂 Glad this helped.

  11. I’m having trouble extracting the files from the zip folder. Once I open the zip folder, the original vsix just appears. Help plz

  12. Should your project be using an external connection string file (https://msdn.microsoft.com/en-us/library/ms254494(v=vs.110).aspx) you can expect to receive the error message “Unable to open configSource file”. This is a bug in the extension which does not move the file in to the temporary work space. You can you can correct the error by manually coping your external connection string file in to %SystemDrive%\Users\\AppData\Local\Temp.

  13. After I’ve done this, I try to open visual studio and I get the error: The Application cannot start.

    I have tried repairing and I did uninstall and install Visual Studio 2015.

    Did any one get this?

    Config:
    Windows 8 Enterprise
    Visual Studio 2015 with all updates up to date

    1. oh no! I’m so sorry to read this. This post has been viewed almost 60,000 times since I published it and this is the very first time I’ve ever heard of it happening. Did you do the manual editing or download the vsix I created? The link to the VSIX has been clicked over 5600 times. So either way, I think a LOT of people have followed this info and I’ve not gotten a single report of this. I sure hope that by the time you read this the problem is fixed. 🙁

  14. I am having a bit of an issue running the tools. No problem with the installation but when I run any of the tools I get “Unable to open configSource file ‘bin\ConfigSourceFileName’ . If I run the tools against a derived DbContext in a project that is not using a configSource file, the tolls work as expected.

      1. Thanks for the quick response Julie. I’m glad you have fond memories of the watershed. We work hard to keep the water clean! I went through the document you linked (that would have been a good thing to do before my post, yes?). Anyway, I set up a DesignTimeHelper project, put a valid connection string in app.config, dumped a table to the console for a sanity check and I’m still having an issue with the Tool. I am now getting a good old “Object reference not set to an instance of an object” . Any direction to point me in would by much appreciated. Thanks so much for your time! john

  15. For some reason, it doesn’t work for me… I’m running VS2015 Professional.
    After select db, i receive this error:
    The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG).

    1. Did you get working? I am having the same issue. For me it is working some month ago and know it is not working any more.

  16. getying this error, any one knows ?
    One or more errors occurred while processing template ‘Entity.tt’.
    error : An exception was thrown while trying to compile the transformation code. The following Exception was thrown:
    System.ArgumentException: Empty path name is not legal.
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
    at System.IO.File.OpenRead(String path)
    at Roslyn.Utilities.FileUtilities.OpenFileStream(String path)
    at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)
    at Microsoft.VisualStudio.TextTemplating.CompilerBridge.c.b__15_0(String x)
    at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
    at System.Linq.Enumerable.d__66`1.MoveNext()
    at System.Linq.Enumerable.d__66`1.MoveNext()
    at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
    at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
    at Microsoft.CodeAnalysis.ImmutableArrayExtensions.AsImmutableOrEmpty[T](IEnumerable`1 items)
    at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable`1 references)
    at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable`1 references)
    at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonWithReferences(IEnumerable`1 newReferences)
    at Microsoft.VisualStudio.TextTemplating.CompilerBridge.PrepareNewCompilation()
    at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Compile()
    at Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(String source, String inputFile, IEnumerable`1 references, Boolean debug, SupportedLanguage language, String compilerOptions)

    One or more errors occurred while processing template ‘Entity.tt’.
    error : An exception was thrown while trying to compile the transformation code. The following Exception was thrown:
    System.ArgumentException: Empty path name is not legal.
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
    at System.IO.File.OpenRead(String path)
    at Roslyn.Utilities.FileUtilities.OpenFileStream(String path)
    at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)
    at Microsoft.VisualStudio.TextTemplating.CompilerBridge.c.b__15_0(String x)
    at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
    at System.Linq.Enumerable.d__66`1.MoveNext()
    at System.Linq.Enumerable.d__66`1.MoveNext()
    at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
    at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
    at Microsoft.CodeAnalysis.ImmutableArrayExtensions.AsImmutableOrEmpty[T](IEnumerable`1 items)
    at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable`1 references)
    at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable`1 references)
    at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonWithReferences(IEnumerable`1 newReferences)
    at Microsoft.VisualStudio.TextTemplating.CompilerBridge.PrepareNewCompilation()
    at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Compile()
    at Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(String source, String inputFile, IEnumerable`1 references, Boolean debug, SupportedLanguage language, String compilerOptions)

  17. Hi Julie, have you been able to get “View Entity Data Model (Read-only)” working with EF Core? I’ve been trying for some time, and I’m finding there seems to be no documentation for it.

    Every time I try it says: “A constructible type deriving from DbContext could not be found in the selected file.” I am using an extension class, but when commenting that out I still get the same result.

    1. For we use the extension (PreGenerating Views) works like a charm.

      Toinstall in VS2017 add a new product entry with: Version=”15.0″
      When installing, ignore the warning of incompatible extension and install.

      1. Thanks Fernando!
        I was a little worried about the warning, but after seeing your comment I went ahead. Up & running now 🙂

  18. I’m getting this error in VS2017: System.ArgumentException: Empty path name is not legal. Any suggestions?

    Also, if everyone seems to like this, then why isn’t being updated by Microsoft?

    David McCarter

  19. For some reason when I want it to create a read-only model, it errors on me.

    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.MissingMethodException: Method not found: ‘System.Collections.Generic.ICollection`1 Business.Entities.Domain.get_Entities()’.
    at API.AuthContext.OnModelCreating(DbModelBuilder modelBuilder)
    at System.Data.Entity.Internal.LazyInternalContext.CreateModelBuilder()
    at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
    at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
    at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
    at System.Data.Entity.Internal.LazyInternalContext.get_ModelBeingInitialized()
    at System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(DbContext context, XmlWriter writer)

    I have a Many to Many relationship defined in fluentApi for domains and Entities. Updating the database works properly, just generating the model fails.

    1. @Chad-
      at the top of this blog post, there’s a link to another post (link says “tool I cannot live without”) and the post is filled with troubleshooting tips for the EDMX viewer of the power tools. I have not done any trials with VS2017, FWIW.
      Julie

  20. Sorry to keep this thread going but it seems to be the only active place on the internet where the issues with EF Power Tools are being discussed.

    I’m running VS 2015 and have a project with .NET 4.5.1 and was able to install the extension. If I run it with this version of .NET i get the error about Entity.tt, if I switch to 4.5.2 I get System.OutOfMemoryException: Insufficient memory to continue the execution of the program.

    There’s 16GB of memory on the laptop so it’s definitely not a memory allocation issue. Anyone have this problem and been able to sort it out

  21. I just downloaded it and there is no longer a SupportedProducts section in the extension.vsixmanifest file:

    https://blogs.msdn.microsoft.com/visualstudio/2013/08/08/update-for-extension-authors-vsix-manifest-version-range-attribute/

    I tried to change the following for VS 2015:

    and got the following error:
    Microsoft.VisualStudio.ExtensionManager.InvalidExtensionPackageException: The file is not a valid VSIX package. —> System.IO.FileFormatException: File contains corrupted data.

    Can anyone help?

    1. Check the note at the top of the page. The community edition works with VS2015 and VS2017. No need to muck about with the vsix any more.

Leave a Reply to Rishabh Bhatnagar Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.