Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

DLL initialization routine failed in .net application

Avatar of capsoftuk
capsoftukFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft Development
4 Comments1 Solution859 ViewsLast Modified:
I really hope someone can help me with this as its been driving me insane for about 3 days now.

I've written an application that uses a COM dll belonging to some software I've installed to run a 'publication'.
Up until about 5 days ago this was working fine but now every time I try to debug or run a built version I get the following error:

    An unhandled exception of type 'System.IO.FileLoadException' occurred in Publish.exe
    Additional information: A dynamic link library (DLL) initialization routine failed.

The DLL that's failing to initialise appears to be HDPublishing.dll as it's failing on the second line of the below.
      HDPUBLISHINGLib.HDIBuilder hdPub1;
      hdPub1 = new HDPUBLISHINGLib.HDIBuilderClass();

Its running under an admin user.

The DLL is an extra one belonging to the software & had to be registered manually & that seems to have worked but it's just not being picked up.
Its included it in the references of the project and I've tried removing it, deleting the .dll from the project folders & then adding the reference again.

This is an application I've been creating in C# based on a VB6 version of it & the compiled VB6 version has also ceased working.
I've tried uninstalling & reinstalling the software & dll numerous times & been through the registry in case there were any stray entries but nothing looks amiss (although I don't know that much about the registry).

The extra dll thats causing the problems isn't listed in the DCOM config but the piece of software its for is & I've given Everyone full rights on it & it hasn't made any difference.
I've also tried giving the local machine & intranet full trust in the .net configuration.

I think the problem may have started when I was working on another project & added a reference to an application that was running on another machine, a newer version of the software my publishing is based on but the reference wasn't for the same library.

Can anyone suggest anything I could try because I'm getting to the point now where I'm sorely tempted to just reformat the machine?

Avatar of jkr
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers