If you are trying to update an older driver it might be helpful to build a new driver project from the current template and look at the driver.cs. Compare the way that the new one does the registration to the way yours does the registration and try to make them alike. The old drivers used a component called Helper or Helper2 to do registration and now it has been moved to a new component called Utilities. You will need to download the utilities class and add a reference to it in your project.
You should end up with something like this...
using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.Windows.Forms;using ASCOM;using ASCOM.Utilities;using ASCOM.Interface;// Your driver's ID is ASCOM.OptecTCF_S.Focuser// The Guid attribute sets the CLSID for ASCOM.OptecTCF_S.Focuser// The ClassInterface/None addribute prevents an empty interface called// _Focuser from being created and used as the [default] interfacepublic class Focuser : IFocuser // // Driver ID and descriptive string that shows in the Chooser // internal static string s_csDriverID = "ASCOM.OptecTCF_S.Focuser"; private static string s_csDriverDescription = "Optec TCF-S Focuser"; //Displayed in Chooser // // Constructor - Must be public for COM registration! // public Focuser() // TODO Implement your additional construction here #region ASCOM Registration // // Register or unregister driver for ASCOM. This is harmless if already // registered or unregistered. // private static void RegUnregASCOM(bool bRegister) //Helper.Profile P = new Helper.Profile(); Utilities.Profile P = new Utilities.Profile(); P.DeviceType = "Focuser"; if (bRegister) P.Register(s_csDriverID, s_csDriverDescription); P.Unregister(s_csDriverID); try Marshal.ReleaseComObject(P); catch (Exception) { } P = null; [ComRegisterFunction] public static void RegisterASCOM(Type t) RegUnregASCOM(true); [ComUnregisterFunction] public static void UnregisterASCOM(Type t) RegUnregASCOM(false); #endregion
