1

Closed

Designer: Unhelpful error message after upgrading to VS2012 using a third party provider

description

This issue was reported via Connect http://connect.microsoft.com/VisualStudio/feedback/details/761883/vs-give-unknown-error-message-while-generating-db-from-ef

The Connect issue records that a few different folks have hit this problem. We haven't been able to reproduce it but it seems like the steps are:
  1. Create a model that targets a non-SQL Server database using VS2010
  2. Upgrade to VS2012
  3. Select 'Generate database from model...'
The result is an error:
--------------------------- 
Microsoft Visual Studio 
--------------------------- 
An exception of type 'Microsoft.VSDesigner.Data.Local.ConnectionStringConverterServiceException' occurred while attempting to generate the database script from the model. The exception message is: ''. 
--------------------------- 
ОК 
--------------------------- 
We definitely need to fix the error message (note the empty string at the end of the message). It looks like ConnectionStringConverterServiceException is owned by another team at Microsoft so we will probably need their help.

If we are able to reproduce the issue we also need to understand why the connection string is becoming invalid.


Here are some notes on a workaround provided by Lawrence:
The error is coming from not being able to interpret the connection string. We don't own the module that does that but from reading the forums it looks like this can often happen if the provider is not properly installed. So if you are upgrading VS make sure you re-install your provider. Once that's done, as an easy workaround, comment out the relevant connection string in your app or web.config. Then go through "Update Model from Database" (selecting nothing new if that's what you want). When it detects that there is no connection string associated with the model it will offer you the page where you get to choose which connection to use. Select your connection and a new connection string with the appropriate format should be put in your .config file.
Closed Jun 28, 2013 at 5:28 PM by RoMiller
Discussed and we are happy with the current behavior. In the scenario that Mugdha mentioned in the comments we are ok with the level of detail coming from ConnectionStringConverterService.

comments

lajones wrote Jun 4, 2013 at 11:40 PM

Fixed with #8d21764. Updated the code to catch the ConnectionStringConverterServiceException which had no message and so was unhelpful and throw a different exception instead with a more helpful message.

Mugdhak wrote Jun 17, 2013 at 10:02 PM

I was verifying this work item. Although I now see a non-empty error message it is not very helpful still. Here is what I see

Microsoft Visual Studio

An exception of type 'Microsoft.VSDesigner.Data.Local.ConnectionStringConverterServiceException' occurred while attempting to generate the database script from the model. The exception message is: 'Data provider "System.Data.SQLite" is not supported.'.

OK

Here are the steps I took.
  1. I installed SQLite from http://system.data.sqlite.org/downloads/1.0.84.0/sqlite-netFx45-setup-bundle-x86-2012-1.0.84.0.exe
  2. Downloaded the SqlLite DB Chinook from https://chinookdatabase.codeplex.com/
  3. Installed VS2012, created model from DB pointing it to Chinook.
  4. Saved the project.
  5. Uninstalled VS2012.
  6. Installed VS Vnext.
  7. Installed EF tools nightly build.
  8. Opened the project.
  9. Chose, generate DB from model. Got the error msg above.
Doesn't look like it is completely fixed.

Mugdhak wrote Jun 17, 2013 at 10:06 PM

sorry for the headers that made the text huge. Here is what the text.

I was verifying this work item. Although I now see a non-empty error message it is not very helpful still. Here is what I see
---------------------------
Microsoft Visual Studio
---------------------------
An exception of type 'Microsoft.VSDesigner.Data.Local.ConnectionStringConverterServiceException' occurred while attempting to generate the database script from the model. The exception message is: 'Data provider "System.Data.SQLite" is not supported.'.
---------------------------
OK   
---------------------------
Here are the steps I took.
  1. I installed SQLite from http://system.data.sqlite.org/downloads/1.0.84.0/sqlite-netFx45-setup-bundle-x86-2012-1.0.84.0.exe
  2. Downloaded the SqlLite DB Chinook from https://chinookdatabase.codeplex.com/
  3. Installed VS2012, created model from DB pointing it to Chinook.
  4. Saved the project.
  5. Uninstalled VS2012.
  6. Installed VS Vnext.
  7. Installed EF tools nightly build.
  8. Opened the project.
  9. Chose, generate DB from model. Got the error msg above.
Doesn't look like it is completely fixed.

mijalmistry wrote Jun 29, 2013 at 2:29 PM

Solution for the above Problem

I found the solution and i tested and it works fine.

Actually two approached are there one can use any approach.

Approach 1

In this approach comment or delete the connection string temporarily and select the update from database option it will open the wizard and ask the connection string and guide you through wizard and you will able to update the entity model.

Approach 2

If your problem is solved from the above approach then it is great but in some cases it throws another error like

An Exception has been occurred. The error is "Event Log is full"

To overcome from this error follow below steps.

1 Open control panel and go to Administrative Tools
2 Open Event Viewer.
3 Right click the Application and select Properties.
4 Increase the size of log file and make sure that it is in multiple of 64K.
5 Apply the changes and save it.

Now go to entity model and try to update it and it works.


Mijal Mistry
MCP,MCTS

Aconcagua wrote Oct 14 at 10:03 AM

Hi Guys

In my case is because I try to open EDMX created for Oracle

But I don't have installed the Oracle Client tools for visual studio, for this the exception

Rgds