Retrieving the COM class factory for component with CLSID {10020200-EB1C-11CF-AE6E-00AA004A34D5} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Line 13: Protected Sub btnUpload_Click(sender As Object, e As System.EventArgs) Handles btnUpload.Click
Line 14: Dim pkg As DTS.Package2
Line 15: pkg = New DTS.Package
Line 16: pkg.FailOnError = True

Tahir AnsariPosted Apr 25, 2023, 9:53 AM
Tuhin paul sir, i have follow your steps but getting error :
regsvr32 "C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTS.dll" failed to load.
Make sure the binary is stored at the specified path or debug it to check problems with the binary or dependent.dll files
Tuhin PaulPosted Apr 23, 2023, 2:39 AM
Part 2
Assuming that you are using VB.NET, try the following steps:
1. Open the Visual Studio command prompt as an administrator.
2. Run the following command: regsvr32 "C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTS.dll" (Note: the path may vary depending on your installation).
3. If the command succeeds, you should see a message indicating that the registration was successful.
4. Try running your application again and see if the error is resolved.
See how you can modify your code to handle the error:
By wrapping the code in a Try-Catch block, you can catch any exceptions that occur and handle them gracefully.
Tuhin PaulPosted Apr 23, 2023, 2:37 AM
Part 1
It is not registered on the machine where the code is running. You can try registering the missing component. Here are the steps to register a COM component:
1. Open a command prompt as an administrator.
2. Navigate to the directory where the component is located using the cd command.
3. Type the following command to register the component:
regsvr32
For example, if the component is located in C:\MyComponent\MyComponent.dll, the command would be:
regsvr32 C:\MyComponent\MyComponent.dll
4. Press Enter and wait for the command to complete.
After registering the missing component, try running the code again. If registering the component does not work, you can try reinstalling the component or checking if the component is compatible with the version of Windows or .NET Framework that you are using.
Amit MohantyPosted Apr 20, 2023, 6:35 AM
The error message you are receiving suggests that the COM class factory for a component with CLSID {10020200-EB1C-11CF-AE6E-00AA004A34D5} cannot be retrieved because the class is not registered on your system. This error can occur if the component is not installed or registered properly on the computer.
It appears that the error is occurring in a web application when the btnUpload button is clicked. The code is attempting to create a new instance of the DTS.Package class, but it is failing to do so because the class is not registered.
Naimish MakwanaPosted Apr 20, 2023, 6:29 AM
It seems that there is an error in your code related to the DTS package. The error message indicates that the COM class factory for the component with the CLSID {10020200-EB1C-11CF-AE6E-00AA004A34D5} failed to register due to the error "Class not registered".
This error usually occurs when the required component is not registered on the machine or the registration is corrupt. You may need to register the component manually or reinstall it.
Here are a few steps you can take to try to resolve the issue: