views:

66

answers:

2

In short, what are the steps that one needs to take in order to modify the source of the connector and install it in Windows?

I have the MySQL Connector/.NET Version 6.1.2 installed on my machine, but I'm getting an exception for every DateTime with a value of '0000-00-00'. This exception breaks my application.

As I solution, I downloaded the source code for the connector and changed the exception so that instead of throwing an exception, it returns the date '0001-01-01 00:00:00'. Although I was able to modify the code and even compile the DLL (NOTE: I commented out the Assembly reference to ConnectorNet), I can't figure out how to install the dll onto my computer. Apparently I'm not able to simply replace the DLL in the Global Assembly Cache because my custom DLL is not strongly typed.

In sum, what are the steps that one needs to take in order to modify the source of the connector and install it in Windows?

Thanks.

A: 

You need the original Private key.

Assemblies in the GAC have a 'strong name', and an encrypted hash is part of that.

Only the owner of the private key can create an assembly with the same public keytoken (digital signature).

You either need the key-pair (a .snk or .pfx file) to sign your new DLL or you will have to recompile the applications that use the DLL.

Henk Holterman
+1  A: 

It's not really recommended you update the .NET connector. A better reason would be to find out why the exception is getting thrown.

If you're getting exceptions when trying to insert a date of 0000-00-00, consider disabling the MySQL's server's NO_ZERO_DATE server mode option.

R. Bemrose
I understand that it may not be a best practice to update the .NET Connector. However, the exception is happening in the connector and I may not have the ability or access to update the database to remove invalid dates.
Ben McCormack