After the COM + component has been written, the next step is how to [Component Service]
In the past, when I used VB6 to write components, I only needed to create an empty package in the component service to register the components, and then I needed to test the components, as long as the machine code of the component is compatible, you only need to stop the package and overwrite the component. Please refer to the video file for component writing and registration process
But enter.. NET development component, Xiao Miao found that the original method cannot be used for processing, must be through 【. net Framework 2.0 (SDK command prompt character), use this command window to register through the following command method, after registration, the component will be stored according to the package specified when the original is written, if the package does not exist
First, in addition to installing. NET Framework 2.0, the server must install the SDK. The link is as follows:
- . NET Framework 2.0
Http://www.microsoft.com/downloads/details.aspx? Familyid = 0856eacb-4362-4b0d-8edd-aab15c5e04f5 & displaylang = ZH-TW
- . NET Framework 2.0 SDK
Http://www.microsoft.com/downloads/details.aspx? Familyid = FE6F2099-B7B4-4F47-A244-C96D69C35DEC & displaylang = ZH-TW
The registration and anti-registration processes are as follows:
Prepare two batch files for registration and anti-registration.
- Register the component (regnetcom. BAT ):
Regsvcs % 1.dll
Gacutil/I % 1.dll
- Unregnetcom. BAT ):
Gacutil/U % 1
Regsvcs/U % 1.dll
- Some people reflected that the original method GAC could not be removed, so xiao meow changed it a little, so that registration and removal would be normal. 【New]
After installation. net Framework SDK, there will be a [SDK command prompt character]. First, copy the component you want to register to the appropriate directory, Meow is usually to copy the relevant DLL to [D: \ Application \ (project name) \], where the project name will be set according to different requirements, for example: D: \ Application \ pdmo
Then copy the above two batch files (regnetcom. BAT and unregnetcom. BAT) to the folder.
Enable the [SDK command prompt character]. If the DLL name generated by the component is pdmomenu. dll, run the following command:
- At registration:
Regnetcom pdmomenu
- During Anti-registration (removal:
Unregnetcom pdmomenu
During Anti-registration, you must note: whether the component is called → If yes → stop the package first
After the component is registered, if it is the first component of the package, you need to set [user identification] for the component so that you can switch the specified account permission to execute the call component as follows:
- Right-click on package → content
- Identifier → use the following users
- Browse → select an appropriate user → enter the account password
- Confirm
as required, when calling components in the package, you can switch to a specified user and execute components with the user's permissions.