Error 80040154 when trying to use SourceSafe via interop on 64bit Windows
We recently moved to Windows 7, and I decided to go with the 64bit version for my machine. One of the utilities we use is a small tool for adding folders to Visual SourceSafe (why we haven't moved to another SCC provider yet is another question!) via the SourceSafeTypeLib interop dll. However, I was most annoyed when it wouldn't work on my machine, the following exception message would be displayed:
Retrieving the COM class factory for component with CLSID {783CD4E4-9D54-11CF-B8EE-00608CC9A71F} failed due to the following error: 80040154.
By default, .NET applications run using the CLR that matches your operating system, ie x64 on Windows 64bit, and x86 on Windows 32bit. I found that if I change the platform target from Any CPU to x86 (you can find this on the Build tab of your project's properties) to force it to use the 32bit CLR, then the interop would succeed and the utility would work again.
Hopefully this will be of use for the next person with this problem. Meanwhile I'm still thinking about a new SCC provider :)
Update History
- 2010-01-19 - First published
- 2020-11-21 - Updated formatting
Leave a Comment
While we appreciate comments from our users, please follow our posting guidelines. Have you tried the Cyotek Forums for support from Cyotek and the community?
Comments
Gluegood
#
Thanks. Just got this error and yours was the first article to help.
Kevin Devine
#
Thanks for this, I have been trying to fix this for about a day...
pauliom
#
Thanks, the longer I use 64bit the longer it takes me to remember that change. Thanks again.
Jagan
#
Even after changing it to X86 i'm still getting the same issue.
Sundar
#
Yes ! Me too even after changing I am getting the same error ? Should we register the DLL ?
Jan Hansen
#
Did you manage to solve the problem? I'm very interested in that. Thanks.
Jan Hansen
#
Same with me, has something changed with newer VS versions? I use 2010 professional. Or with newer OS?
Jan Hansen
#
I finally found out, that although registering the dll fails, the ssapi.dll has to be registered, what worked out without problems.
Richard Moss
#
Hello,
Thank you for the comment, that was interesting to know.
ssapi.dll
is a COM dll and so should register correctly (although at the same time it should already be registered from installing VSS), but in newer version of Windows you'll probably need to be running an elevated command prompt in order to register it withregsvr32.exe
.Regards; Richard Moss