Hi,
I would like to build COM component add-in using C# instead of VB.NET. Since QSRules.dll is not strong named, I cannot reference it directly in C# ..NET.
Here is what I did.
- Create C# Class library.
- sn -k AddInTest.snk
- Add this line [assembly: AssemblyKeyFile("AddInTest.snk")] in AssemblyInfo.cs
- Declare Entry Point. public bool Process(QSRules.SessionClass session) { MessageBox.Show(session.Cashier.Name.ToString()); return true; } Unfortunately, it cannot be compiled because QSRules is not strong named. So it give error message saying that "Assembly generation failed -- Referenced assembly 'Interop.QSRules' does not have a strong name ". As far as I know, RMS customized add-in component should be strong named to be installed in assembly cache.
So I tried to change the entry point code like VB.NET
public bool Process(object session) { MessageBox.Show(session.Cashier.Name.ToString()); return true; }
Obviously, this code only works for VB.NET because as far as I know, VB.NET is very generous lanague. Since C# is strong typed language, session object DOESNOT know what the Cashier is at compile time, so it generates error.
How do I write COM add-in component using C#?
Does anyone know to workaround for this?
Thank you in advance.
..............................................................TJ