Entity Framework in Visual Studio 2013 library not found

entity-framework vb.net visual-studio

Question

I get a rather unusual error in Visual Studio 2013 in Visual Basic when trying to work with Entity Framework. This doesn't matter whether I work with an existing project or create a new one. It started to happen when I changed to a new PC with Win 8.1.

I create a new model using the wizard from a database. It creates the diagram very nicely. However, I get an compilation error telling the library EntityFramework.dll doesn't exist. However, the only thing is that the path to EntityFramework.dll is wrong (Looks like: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\..\IDE\EntityFramework.dll). The address, however, would be D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE. Where would I change that value?

Ueli

1
8
11/8/2013 8:11:13 PM

Popular Answer

Apparently when reinstalling Visual Studio to a different drive the %VS120COMNTOOLS% environment variable is not updated correctly and points to the folder on the drive where VS was originally installed. The template for generating DDL SQL is using the %VS120COMNTOOLS% environment variable to find assemblies it needs to generate the code. Since the variable is pointing to a folder that no longer contains the necessary files the T4 template transformation fails.

Troubleshooting:

  • Open the developer command prompt for VS2013
  • set the variable manually to point to the correct location (e.g.

    set VS120COMNTOOLS="D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\")

  • start VS from the command prompt by executing devenv
  • verify if things now work

(Note that if you follow the above steps to set the variable it will only work for VS instances started from this command prompt.)

If the above works go to the computer properties (e.g. in Win 8/Win 8.1 type "This PC" in the search window), right click on the icon and select "Properties", go to the "Advanced" tab and click the "Environment Variables" button, then in the "System variables" window find the VS120COMNTOOLS variable, double click (or click the "Edit" button) and fix the variable so that it points to the right folder.

Don't forget the last backslash after Tools... C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools <---- will not work, but... C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\ <--- will work

25
2/23/2015 3:15:41 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow