M
Mr. Mountain
Hi,
I am building a custom wizard engine in C# following the example in
"Mastering Visual Studio.NET" by Griffiths, Flanders and Sells (pg 304).
Unfortunately, I'm having several problems that the book isn't helping me
overcome. (It is a good book, but O'Reilly hasn't made code available and so
far not a single example I've tried from the book has worked!)
To build a COM server in C# that implements the IDTWizard interface, does
the assembly have to have a strong name? The book says yes. However, the
MSDN page at
http://msdn.microsoft.com/library/d.../en-us/dv_vstechart/html/customprojectwiz.asp
indicates otherwise. The MSDN example shows only the following changes to
AssemblyInfo.cs:
//COM+ related settings
//
[assembly: ApplicationName("Custom Component")]
[assembly: ApplicationID("[!output GUID_COMPLUS]")]
[assembly: Description("Custom component using C#.NET")]
Not being familiar with COM, I can only assume that either approach
(assigning an AssemblyKeyFile or using the GUID for the applicationID) will
work. I have tried both -- even both at the same time-- but without success.
When I try to run my wizard, I simply get a message box error saying "could
not run the '...' wizard".
My guess is that I have a COM registration problem. My project properties
have RegisterForComInterop = "true" set. The build output window indicates
COM registration is being done. Still, I can't run the wizard.
I have tried running regasm manually, but that doesn't seem to change
anything.
To summarize, here are my questions:
1. To build a COM server in C# that implements the IDTWizard interface, do I
need to sign the assembly with a key pair?
2. Do I need 2 GUIDs (one for the class and one for the ApplicationID)? If
not, which GUIDs do I need?
3. How do I register my C# COM server? (And how can I validate that it is
registered properly?) I assume VS.NET 2003 is doing this automatically, but
if not it seems that running regasm should be good enough...
4. Does it matter which folder I place my dll in? (I am pretty sure it does
not matter, but just checking)
5. Given that I seem to be getting failure before my dll is found, my
breakpoints are never hit. What would be the appropriate debugging technique
at the stage where I'm having problems?
Thanks!
Mountain
I am building a custom wizard engine in C# following the example in
"Mastering Visual Studio.NET" by Griffiths, Flanders and Sells (pg 304).
Unfortunately, I'm having several problems that the book isn't helping me
overcome. (It is a good book, but O'Reilly hasn't made code available and so
far not a single example I've tried from the book has worked!)
To build a COM server in C# that implements the IDTWizard interface, does
the assembly have to have a strong name? The book says yes. However, the
MSDN page at
http://msdn.microsoft.com/library/d.../en-us/dv_vstechart/html/customprojectwiz.asp
indicates otherwise. The MSDN example shows only the following changes to
AssemblyInfo.cs:
//COM+ related settings
//
[assembly: ApplicationName("Custom Component")]
[assembly: ApplicationID("[!output GUID_COMPLUS]")]
[assembly: Description("Custom component using C#.NET")]
Not being familiar with COM, I can only assume that either approach
(assigning an AssemblyKeyFile or using the GUID for the applicationID) will
work. I have tried both -- even both at the same time-- but without success.
When I try to run my wizard, I simply get a message box error saying "could
not run the '...' wizard".
My guess is that I have a COM registration problem. My project properties
have RegisterForComInterop = "true" set. The build output window indicates
COM registration is being done. Still, I can't run the wizard.
I have tried running regasm manually, but that doesn't seem to change
anything.
To summarize, here are my questions:
1. To build a COM server in C# that implements the IDTWizard interface, do I
need to sign the assembly with a key pair?
2. Do I need 2 GUIDs (one for the class and one for the ApplicationID)? If
not, which GUIDs do I need?
3. How do I register my C# COM server? (And how can I validate that it is
registered properly?) I assume VS.NET 2003 is doing this automatically, but
if not it seems that running regasm should be good enough...
4. Does it matter which folder I place my dll in? (I am pretty sure it does
not matter, but just checking)
5. Given that I seem to be getting failure before my dll is found, my
breakpoints are never hit. What would be the appropriate debugging technique
at the stage where I'm having problems?
Thanks!
Mountain