I got an error like 'System.Runtime.InteropServices.COMException:COM object with CLSID {100202C1-E260-11CF-AE68-00AA004A34D5} is either not valid or not registered.', when I was just trying to select a server from the server drop down list on the database setup form.
The reason for this error is that the sqldmo.dll has been unregistered. To resolve this issue you will need to re-register it.
The following steps demonstrate how to re-register the sqldmo.dll:
- Go to 'Start -> Run', type 'cmd' and 'Enter' to open the command line console in your Windows.
- At the command line, go to the directory where the sqldmo.dll located in (i.e. "cd <folder>").
If you have SQL server installed on the same machine, the sqldmo.dll can be found at a location like 'C:\Program Files\Microsoft SQL Server\80\Tools\Binn\'.
If you don't have SQL server installed, the sqldmo.dll can be found under the SSW products installation directory. - Type 'regsvr32 sqldmo.dll' and press 'Enter'.
Developers should follow these steps to avoid this error when packaging their application:
- Add sqldmo.dll into the package.
- Add a condition for component to be installed, SQLVERSION =0 OR MaintenanceMode = ""Remove"".
- Check 'Leave installed on uninstall'
Figure: Add sqldmo.dll into Wise installation package
We have a suggestion on this issue to Microsoft. See our Better Software Suggestions for .NET