I have built a simple WPF application just to gain some experience with it.
All it does is get information from a database when a user clicks on a button.
The application works fine in my PC(using the publish option), but when I tried running it on my laptop and my friends’ PC, the app crashed as fast as the button was pressed.
I’m 99% sure it has something to do with Entity Framework, which I use to contact the database (all the the function that gets fired on the button click does is contact and retrieve info from the DB).
After looking for answers in google I found out that it may have something to do with either the .net installation in the PC, OR the project references.
However, the .net FW version is the same in my PC and my laptop, and the references were all marked as copy-local (just for testing!).
What else could cause such problem? I really have no idea anymore…
UPDATE
Using exceptions, I found out that the error I got was:
The specified store provider cannot be found in the configuration, or is not valid.
I also solved this problem by searching deeper in Google.
The solution can be found below…
Happy coding!
I finally solved it!
This is how to do it:
1) Make sure your project has a reference to MySql.Data.dll, MySql.Web.dll, MySql.Data.Entity.dll and System.Data.Entity.dll.
2) Set all of the above to Copy-Local.
3) Add the following lines to your
App.configfile:4) Click on the MySQL.Data reference, and check it’s version. It can be found in the ‘Properties’ window below the solution explorer after you select it.
5) Change the
Version=6.4.4.0part to the version of your MySql.Data.dll. Mine was 6.5.4.0 which is the newest but older versions should work just as fine.Also, I’d like to thank Ralf de Kleine and everyone else who answered for putting up/suggesting the exception code.
It was dumb of me to not think about using exceptions when they’re just so convenient!