Why did my application's reference link to MccDaq.DLL break?


The MccDaq.DLL is used in many places, for the subject of this Knowledgebase article, it refers to use in Microsoft Visual Studio programming such as Visual Basic.NET, C Sharp.NET and C++.NET.

To gain access to the Universal Library in .NET, you add a reference to MccDaq, to your project .

MccDaq.DLL is revision controlled.  It get revised whenever a new library function, parameter or constant is added to the Universal Library, or a bug is discovered and resolved.

Most people will never have this problem.  However if you are a programmer, have added MccDaq to your project, and then install a newer version of the MccDaq CD, you might find your program will not compile because of errors now present all stating "MccDaq is not declared" or similar error.

This occurs because MccDaq.dll is added to Windows Global Assembly Cache or 'GAC' when it is installed. The GAC makes it possible to maintian and control multiple versions of DLLs on your system.  At the time, Microsoft referred to this as, "The end of DLL hell."

For example, when InstaCal/Universal Library version 6.30 was released, MccDaq.DLL was at revision 2.1.0.0.  When version 6.31 was released, MccDaq.DLL was incremented to revision 2.2.0.0.  If you had a project you were working on upgraded the MCC software at that time, you would have notice the Error List at the bottom of the IDE showed a list of errors, and the MccDaq reference in the Solution Explorer had an added yellow triangle with an exclamation mark.

To clear the error, there are 2 options:

1.  select the MccDaq reference from the Solution Explorer, go to the properties window and change the Specific Version Property to False.  This will make your project use a static version of the DLL.

2.  From the Solution Explorer, right click on the MccDaq reference, select Remove. Then right click on References, select 'Add Reference...'.  When the Add Reference dialog box appears, click on the .NET tab, and scroll down and select MccDaq, and then click on OK.  This is the preferred solution.

This problem will not occur once you compile your program, create an installer and deploy your program. Whatever version of the MccDaq.DLL you include in your project will be added into the GAC.

Posted 2/7/2014 10:05:24 AM by Jeff
https://kb.mccdaq.com/KnowledgebaseArticle50508.aspx