If I use the following commands on the code at the bottom, I get an
error (0x80070002) when I try to CoCreateClass (ether from within OLE/
COM viewer or with python's win32com library):

    csc /target:library /r:mscorlib.dll /r:System.Windows.Forms.dll /
out:TestKeyManagement.dll TestKeyManagement.cs
    regasm TestKeyManagement.dll /tlb

But this works:

    csc /keyfile:TestKeyManagementKeyPair.snk /target:library /
r:System.Windows.Forms.dll /out:TestKeyManagement.dll
TestKeyManagement.cs
    regasm TestKeyManagement.dll /tlb
    gacutil -i TestKeyManagement.dll

Can anyone explain why?

========
TestKeyManagement.cs
========
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyDescription("TestKeyManagement 1.0 Type Library")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: Guid("0E84DDE2-A6FC-45de-8B15-3916FFB932BC")]

[Guid("17FB4DE2-1ECB-4cb2-A043-A2D751B16A3B"),
InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface ITestKeyManagement {
    [DispId(1)] void ManageKeys();
}

[ClassInterface(ClassInterfaceType.None)]
[ProgId("dcc.TestKeyManagement.1")]
[Guid("F2A67839-01DE-43c3-A402-4765CF25ED51")]
public class TestKeyManagement : ITestKeyManagement {
    public void ManageKeys() {
        MessageBox.Show("I'm managing keys from within C#");
    }
}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---

Reply via email to