• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

17. .NET > 17.2. Call a .NET Component Containing a Parameterized Constructor

17.2. Call a .NET Component Containing a Parameterized Constructor

Problem

Attempting to call a .NET class containing a parameterized constructor generates the compile error “Invalid use of New keyword”. Is there some sort of workaround so that I can call a .NET class containing a parameterized constructor?

Solution

To see the problem, you will need to follow these steps:

  1. Start a Visual Studio .NET command prompt and run the RegAsm utility program on the Geometry.dll file found in the Geometry\bin folder of this chapter’s sample files using the following syntax (see topic 17.1 for more details on the Visual Studio .NET command prompt and running the RegAsm utility):

    regasm Geometry.dll /tlb: Geometry.tlb /codebase

    RegAsm will display a warning about this being an unsigned assembly but you can safely ignore the warning.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint