Blog Stats
  • Posts - 42
  • Articles - 0
  • Comments - 61
  • Trackbacks - 36

 

Friday, October 07, 2005

Learning COM+ components

  1. Create a class inherited from ServicedComponent class by referencing System.EnterpriseServices.
  2. Write the logic in it and declare methods.
  3. Add class hierarchy as necessary.
  4. Compile the project.
  5. Go to command prompt and on to the bin\debug folder, and type in
     sn -k CalculatorServiceComponent.snk
     This is to strong-name and write the key pair to the .snk file.
  6. Move the .snk file to the root of the project folder.
  7. Have the following line in the AssemblyInfo.cs file of the project.
     [assembly: AssemblyKeyFile("..\\..\\CalculatorServiceComponent.snk")]
  8. Go to command prompt again and run,
     regsvcs CalculatorServiceComponent.dll
  9. You might get couple of warnings, which can be ignored depending on the severity.
  10. Go to Component services from control panel and look up the created COM+ components and the methods that have been defined.
 

 

Copyright © Vinayak