views:

47

answers:

1

Hi, I have a .Net project which uses the MySQL connector which is located in the GAC.

In my Nant build file there doesnt seem to be a way to tell CSC to look in the GAC to find this dll (or type information) and my project wont build.

Is there a way to tell Nant that this reference does exist and its in the Gac.

Its wierd really because obviously all of the Microsoft libraries e.g. "System" are in the Gac and it doesnt have a problem building anythign referencing those. I have confirmed that the Mysql Connector is also in the Gac.

Thanks.

+1  A: 

csc looks for DLLs in the current directory, in the framework directory, in the directories mentioned in the /lib switch, in the directories mentioned in the LIB environment variable.

But not in the GAC. You could compile with csc /r:full_path_to_the_gac_file.dll, it works but is not very user-friendly.

.NET assemblies are installed in two places: in the GAC and in the framework directory (which explains why they are found).

You should copy the DLLs you need in a given directory and reference it with the /lib switch. Of course, at run-time, it will be taken from the GAC.

Timores