iFinity Blogs 

Jun 3

Written by: Bruce Chapman
Wednesday, June 03, 2009 4:36 PM 

Every programmer loves to have a little kit-bag of common functions, workarounds, hacks and shortcuts.  It's the stock-in-trade of a seasoned developer : they've seen the common problems before, developed a solution once, and unit-tested the living heck out of it.   The iFinity.Utilities DLL is such a file : it's a very small .NET library which contains base classes, common functions, database shortcuts and the like.   It's been bundled into quite a few of the DNN modules that I have distributed over the years.

There's a small problem though : DotNetNuke doesn't really 'do' shared file installations for modules.  Basically, if you include a file in a module manifest (the listing of all the resources that get installed with a module), DNN remembers that you copied the file in when a module was installed.  And, when you uninstall that module, it takes the file straight back out again.  It's a modern, DNN version of the old DLL hell you could get yourself into with Windows 95 and COM.

Now back when I was first writing and packaging DNN modules, I pretty much included this file into anything and everything.  This was a mistake that is coming back to snap at my heels

If you uninstall one iFinity module (with the iFinity.Utilities.dll in it) and keep another iFinity Module that requires the utilities DLL, then you will cause file not found errors in your site.  These might range from minor (a feature won't work) to critical (the entire site will not work).  Which error you get depends on which module you installed, and which module you uninstalled.

Needless to say, you don't want any of these to affect your site.  However, I suspect the vast majority of readers of this blog entry are here because they found the blog entry after search for 'ifinity.utilities.dll broke my site', and aren't particularly happy about it.  To those readers, I apologise sincerely - it's a mistake made on my part just to make packaging and version control easier, which conversely has made it much more difficult.

How to fix "Could not load file or assembly ''iFinity.Utilities, Version=1.0.0.0" errors.

The simplest, easiest way to fix the problem is you're facing it is to manually extract the iFinity.Utilities.dll file from the module you installed (or uninstalled), and drop the iFinity.Utilities.dll file into the \bin directory of your website.  You may have to FTP up the file to do this.  To manually extract the file, just open up the iFinity.Product_xx.yy.zz_Install.zip for the installed module in Winzip, or other compression utility (Windows has a compression utility built in).

Tagger Module Special Case

With the Tagger module, the problem manifests itself in strange ways.  With version 1.5 and 1.5.2, there's also a bug in the uninstall process, which means you neither have a working tagger module, nor are you able to fix it because of the missing file.  Typically, you'll end up with an error that looks like this : DotNetNuke.Services.Exceptions.ModuleLoadException: Invalid object name 'ifty_TagInstanceLink'.

The solution is to download and install a newer version (1.6 or better) of the Tagger module.  The installation file can be found on the Tagger Product Page (download link at the bottom).  Installing the newer version will repair the install of the older version, and also allow you to uninstall without any problems. 

Going Forwards

I'm systematically eliminating this file from every single place that it is used.  I have already done this for several modules, the rest will be done as and when possible.  In most cases it requires rewriting certain parts of the module and updating the module packaging.  In others it's just a case of removing it from the list of things to copy.

I will note in the Release notes for individual modules when this file dependency has been removed.  In some cases, you'll need to upgrade to the latest version before it is definitely safe to remove the module.  One step forwards, two steps back, in a way.

And you can be certain that there will absolutely no shared components between modules going forwards.  I've certainly learned my lesson on that one.

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
Bruce Chapman
Hi, I'm Bruce Chapman, and this is my blog. You'll find lots of information here - my thoughts about business and the internet, technical information, things I'm working on and the odd strange post or two.

Page Tags