I am using VS 2013 and SQL Svr 2012 and trying to use EF to populate a gridview. Since this is a very simple test, I have only one table with a key and several data fields. The process of creating the model seems to work fine - it shows, as expected in the designer’s view, the files are created in app_code, a folder with two dll files is created, and the configuration file is updated with the connection string and other entries.
When I try to select a “named connection”, I get the error “Unable to load the specified metadata resource” and it says rebuilding the project to get the assemblies.
I spent hours reading other similar cases, and I cannot understand:
Why does this happen when it has never been a problem with VS 2010
How to fix the connection string to indicate the resources it needs. I completely lost all the technical advice about fully qualified assembly names - nothing is trying to work.
How to set some parameter to force resources to be in the right place? All the tips that I read do not seem to apply very well to VS 2013.
I need to decide whether I should just uninstall VS 2013 and use VS 2012. I am currently using VS 2010 with ASP 4.0, and I would like to upgrade to ASP 4.5 and generally keep up with Microsoft technology. However, I do not have the skill level to solve the problem with the VS version, which is a bug. It seems to me that this EF implementation can be caused either by an error or by incorrect damage on my computer - I'm trying to find out what is happening. I installed VS 2013 Express and SQL Svr 2012 on a clean machine that did not have any of these tools in the past.
I would really like someone who is very familiar with Visual Studio to try to replicate my problem, as it only takes a few minutes:
In MS SQL Server, create a tiny database with one table in which there is a primary key and several data fields, and is filled with some test data. Call it TinyDB with TestTable1.
Using VS 2013 Express for the Web, create a “New Website” with the option “Empty ASP Website” using VB.
Add the ASP App_Code folder containing the "ADO.Net Entity Data Model" and leave the name "Model".
Create a model from the database and create a “New Connection” for “TinyDB” and using Entity Framework 6.0, and then select “TestTable1”. Note that the namespace is "TinyDBModel". By clicking Finish, you will create several items in App_Code, other folders, and also update web.config.
Add a web form called default.aspx and drag the grid onto it. In design mode for gridview, select "new data source" and then the "Entity" parameter (note name EntityDataSource1, which appears in default.aspx). Click Next and Named Connection, select TinyDBEntities - here is my error, "Cannot load the specified metadata resource."
Please note that this exact exercise in VS 2010 works great and creates a grid with the correct data displayed.
source share