0

Just made a simple WPF MVVM app using Entity Framework 6 with a MySQL db. When I try to run it on another machine it crashes even before showing the UI

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01:   credit.exe
Problem Signature 02:   1.0.0.0
Problem Signature 03:   5857d84b
Problem Signature 04:   System.Data
Problem Signature 05:   4.0.30319.18408
Problem Signature 06:   52311175
Problem Signature 07:   9c4
Problem Signature 08:   2b
Problem Signature 09:   System.Windows.Markup.XamlParse
OS Version: 6.1.7601.2.1.0.768.3
Locale ID:  1026
Additional Information 1:   0a9e
Additional Information 2:   0a9e372d3b4ad19135b953a78882e789
Additional Information 3:   0a9e
Additional Information 4:   0a9e372d3b4ad19135b953a78882e789

So I made a virtual machine with only .net 4.5 redistributable and tried running the app with no luck. Then I installed the MySQL Connector Net 6.9.9 (core only) and the app now starts. Even tho the app folder has all the dll files that the connector installs, it can't run without it being installed.

I tried googling this problem but couldn't find any mention of it anywhere.

EDIT

So the question is why can't the app start without the connector being installed and works fine even if i delete the mysql folder in program files ?

4
  • Thanks for the status report. Was there a question ? Commented Dec 19, 2016 at 17:07
  • EDITED: now includes a simple 2 line question Commented Dec 19, 2016 at 17:11
  • 1
    Because the installer probably adds a DbProviderFactories entry to machine.config. Here's a bug report about an install that was failing to do this bugs.mysql.com/bug.php?id=69760 There's some info in that thread about adding the required sections to app.config in order to fix. Commented Dec 19, 2016 at 18:00
  • Thank you Will. After reading the bug report I added DbProviderFactories to the config file of my app and now it works great Commented Dec 20, 2016 at 8:29

2 Answers 2

1

SOLVED:

Just added this code to my app.config and now it works without the connector being installed.

<system.data>
<DbProviderFactories>
  <remove invariant="System.Data.SQLite" />    
  <remove invariant="MySql.Data.MySqlClient" />
  <add name="SQLite Data Provider" description=".Net Framework Data Provider for SQLite" invariant="System.Data.SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
  <add name="MySQL" description="ADO.Net driver for MySQL" invariant="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data"/>
</DbProviderFactories>

Thank you, Will, for the help

Sign up to request clarification or add additional context in comments.

Comments

0

Connector/Net lets you easily develop .NET applications that require secure, high-performance data connectivity with MySQL. It implements the required ADO.NET interfaces and integrates into ADO.NET-aware tools. Developers can build applications using their choice of .NET languages. Connector/Net is a fully managed ADO.NET driver written in 100% pure C#. It does not use the MySQL C client library.

It also implements different protocols for connecting to the database from a .net based application. So without the connector your c# application cannot connect to the mysql database.

Consider an example. You don't have .net framework installed and you try to run a windows application with all exe's and required files. It will not work. It is almost the same situation here.

So without installing the connector the registry will not be updated and windows will not be able to connect to mysql.

1 Comment

That's not what the OP is asking. He's asking why copying the assemblies locally to the install directory fails to work, but using the installer makes it work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.