Hi ,
I am having a .Net Activex control. I have done coding for COMRegistering and Unregistereing in C#.Net. The code is follows..
[ComRegisterFunction]
static void ComRegister(Type t)
{
string keyName = @"CLSID\" + t.GUID.ToString("B");
using (RegistryKey key =
Registry.ClassesRoot.OpenSubKey(keyName, true))
{
key.CreateSubKey("Control").Close();
using (RegistryKey subkey = key.CreateSubKey("MiscStatus"))
{
subkey.SetValue("", "131457");
}
using (RegistryKey subkey = key.CreateSubKey("TypeLib"))
{
Guid libid = Marshal.GetTypeLibGuidForAssembly(t.Assembly);
subkey.SetValue("", libid.ToString("B"));
}
using (RegistryKey subkey = key.CreateSubKey("Version"))
{
Version ver = t.Assembly.GetName().Version;
string version =
string.Format("{0}.{1}",
ver.Major,
ver.Minor);
if (version == "0.0") version = "1.0";
subkey.SetValue("", version);
}
}
}
[ComUnregisterFunction]
static void ComUnregister(Type t)
{
// Delete entire CLSID\{clsid} subtree
string keyName = @"CLSID\" + t.GUID.ToString("B");
Registry.ClassesRoot.DeleteSubKeyTree(keyName);
}
When i Build this .Net project this control is getting registering in the registry and i am able to add this .net control in vb 6.0 form also. its working fine.
I want to test this dll on any other system other than developer machine....
Then i tried to register this dll through Regasm.. The control is registered succefully. but when i tried to add this control in to vb 6.0 form.. I am getting this error: Class not Registered .Looking for Object with ClsId :{...}..
Then i send full .net project to that system and build the .net appliaction. then it is registered fine and working fine in vb 6.0 also.. the problem is comming if i registered that dll through command line.. what is the solution for this...
Plz Help ....