Closed ErikEJ closed 5 years ago
Yes @ErickEJ, that is correct.
@lajones, @ajcvickers it seems that the call to GetProviderInvarianName:
Which we introduced as part of one of the improvements, throws for SQL CESQLite, at least in some cases. Perhaps this is due to the provider being configured for the application but not for VS or machine.config?
It is for SQLite, have not tested with SQL CE, but I will
Thanks for clarifying. My brain’s lookup tables contain some stale entries :smile:
Perhaps the connection.GetProviderInvarianName() extension method operates on EF configuration. I think we have another version of the method on DbPrividerFactoy. Not sure if it has the same issue.
Just tested with SQLCE, and it is working
Assigning this to @lajones. I think we can be more defensive in calling connection.GetProviderInvarianName()
and if it throws, then assume that it's not SQL Server. We may want to do a 6.2.1 patch for this.
Any suggestions for workarounds?
Agreed on the defensive calling. But for now it looks as though it's having problems with reading the something in the <system.data><DbProviderFactories>
section of the app.config
. Or maybe it's setting up it's cache incorrectly. Are the <remove>
entries necessary? Can they be removed, or moved so that all <remove>
entries are before all the <add>
ones? I wonder if somehow removing System.Data.SQLite
is affecting System.Data.SQLite.EF6
as well?
Diego pointed out that this is in the designer code, which isn't in 6.2, so changing the milestone to reflect that. Once we have a fix we should ask Barry which VS branch to target with it.
@lajones Those are some valid questions, but given that we are only using this to detect SQL Server, then I think we can just swallow any exceptions since we know that SQL Server, when configured correctly, will work and anything else doesn't really matter.
@ajcvickers Agreed. My suggestions are just for what customers can try to workaround this problem before we get a fix out to swallow the exceptions. Note: I don't know if the suggestions above will work but it's worth a try.
I agree that the minimal solution would be to catch and ignore the exception, because we are only trying to detect SQL Server, which is usually registered in machine.config.
If my suspicion is correct, this is happening because the SQLite provider is registered in the application's config and not available to the designer code that is running inside the VS process. Then a possible workaround would be to put the registration of the provider in machine.config or in devenv.exe.config.
I tested and documented the workaround here: https://github.com/ErikEJ/SqlCeToolbox/wiki/EF6-workflow-with-SQLite-DDEX-provider
Erik - tried the workaround, now I cannot get past the first step of the "Entity Data Model Wizard" (click Next it just vanishes).
I tried deleting all of my existing Sqlite connections -- didn't help.
Attaching the error I was receiving before the workaround. ef-sqlite-exception.txt
Sounds like you did something wrong with your machine.config modification - did you double check all the wiki instructions? Or share your machine.config file...
I copied machine.config.default to machine.config and the wizard still vanishes... and yes, I double-checked everything. I tested the default machine.config with and without the DbProviderFactories section... wizard still crashes. Does this dialog report crashes anywhere?
After deleting all existing connections, the wizard went forward one step to making a connection, but the Connection Properties for Sqlite Provider contains only Misc -> ConnectionString... the Test Connection button works, but if you try to OK the dialog, you get:
The SQLite provider is not properly installed, check if the SQLite provider is in GAC, as described in the wiki article
You are correct, I looked at your about and it says it's not in the GAC... not sure how that happened, but I reinstalled and it's there now.
Although, when I add your suggested workaround into the machine.config, it blows Visual Studio up. If I click past this error, the theme never loads (Dark) and Visual Studio thinks it's not registered... but, if copy the default machine.config back and then run Visual Studio... everything is fine.
The 'CreateLayoutWizardPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\chris.dickerson\AppData\Roaming\Microsoft\VisualStudio\15.0_22f7eb32\ActivityLog.xml'. Restarting Visual Studio could help resolve this issue.
Continue to show this error message?`
If you do not share your modified machine.config, it is impossible for me to give you any advice
@Chris-Dickerson Did you read the wiki article? " You can add the following entry" - meaning both sqlite machine.config entries must be present, the first one will be added by the SQLite Tools installation? Did you install them?
Yes I installed the tools. (sqlite-netFx46-setup-bundle-x86-2015-1.0.108.0.exe)
Then something went wrong during install, or you gave me the wrong machine.config file
I have everything as described by your page, I can generate the framework. The app.config configuration on your instruction page doesn't work for me, I receive an error. But If I put it back to the way I had it previously, it works.
What makes it work is adding back:
provider:
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
And to the factories:
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
Feel free to share an app.config file that works for you, and I will try it out
There is indeed some peculiar uninstallation of the provider out of nowhere (I had installed it minutes before and I had confirmed with the about window that it was installed so there was no way it was not installed).
@ErikEJ Just want to say thanks for all your work on helping people with this!
@ajcvickers You are welcome, I brought it on myself by adding the DDEX provider to VS 2017 😢
I'm using VS.NET Enterprise 15.7.2 and I tried to follow all the steps described for the workaround. Unfortunately I'm still experiencing the same issue.
Also, I've seen that 3.24 has been release, but the setups for .NET Framework 4.6 are still the same.
If you can share a project and your machine.config, I can have a look
Erik,
Please, find attached a basic WPF project containing the specific package references and as well the machine.config file WpfApp2017324.zip
Thank you in advance
Fix will appear in internal VS builds tonight. Will be publicly available in 15.8 Preview 4. (Solution was just to swallow the exceptions - so that if GetProviderInvariantName()
fails it will be treated the same as if it was not SQL Server.)
@dcppat I am also not able to make your project work, you will have to wait for VS 2017 15.8 preview 4 or generate the code in VS 2015
@lajones and @ErikEJ,
Thank you for your help. Tell me, please, do we know what would be the official release date?
@dcppat Sorry, we aren't able to publicly announce the date. But I'll post back here when it's available.
@dcppat 15.8 Preview 4 is now publicly available.
@ErikEJ Have you (or any one else) have tried 15.8 preview 4 version and verify that this issue has finally been resolved?
i have installed the 15.8.5 preview, still not able to produce an edmx
@bgvsan I'm using Dapper with SQLite. It took a lot of time with EF.
@bgvsan What error do you get?
opening the edmx
@lajones Are you able to verify the fix?
@bgvsan can you please describe the exact repro steps to get this dialog? We suspect we could be looking at a different bug, or even some side effect of the workaround.
In the original bug report there was a different messages and a stack trace in the output window. Can you please compare what you are seeing with https://github.com/ErikEJ/SqlCeToolbox/issues/710#issue-322025452?
ok I created a new project and seems edmx working with vs 15.8.5 preview, probably there is something into my old project I have to figure out.
Is there an ETA on when the this code fix present in 15.8.5 will be rolled out as a stable update?
Around .NET Conf maybe?
@ErikEJ I receive an old project in EF 5.0 and I am using VS 15.8.2; I try to upgrade the EF but fails, and I keep failing, any suggestion?
@dalabe Please post an issue with actionable repro steps and error messages / stack dumps
2 of my users have seen issues with 15.7 - am I correct that the 15.7 release finally contains the EF 6.2 tooling?
See detailed repro steps here: https://github.com/ErikEJ/SqlCeToolbox/issues/710
Further technical details
EF version: EF 6 Database Provider: SQLite IDE: Visual Studio 2017 15.7