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 :)

About The Author

Gravatar

The founder of Cyotek, Richard enjoys creating new blog content for the site. Much more though, he likes to develop programs, and can often found writing reams of code. A long term gamer, he has aspirations in one day creating an epic video game. Until that time, he is mostly content with adding new bugs to WebCopy and the other Cyotek products.

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?

Styling with Markdown is supported

Comments

Gluegood

# Reply

Thanks. Just got this error and yours was the first article to help.

Gravatar

Kevin Devine

# Reply

Thanks for this, I have been trying to fix this for about a day...

pauliom

# Reply

Thanks, the longer I use 64bit the longer it takes me to remember that change. Thanks again.

Jagan

# Reply

Even after changing it to X86 i'm still getting the same issue.

Sundar

# Reply

Yes ! Me too even after changing I am getting the same error ? Should we register the DLL ?

Gravatar

Jan Hansen

# Reply

Did you manage to solve the problem? I'm very interested in that. Thanks.

Gravatar

Jan Hansen

# Reply

Same with me, has something changed with newer VS versions? I use 2010 professional. Or with newer OS?

Jan Hansen

# Reply

I finally found out, that although registering the dll fails, the ssapi.dll has to be registered, what worked out without problems.

Gravatar

Richard Moss

# Reply

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 with regsvr32.exe.

Regards; Richard Moss