allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.remkoweijnen.nl%2Fblog%2F2012%2F07%2F18%2Fcould-not-load-file-or-assembly-system-configuration%2F&text=Could%20not%20load%20file%20or%20assembly%20%E2%80%98System.Configuration%E2%80%99&count=vertical&lang=&via=@remkoweijnen" style="width: 65px; height: 65px;">

Today I was asked to troubleshoot an executable that didn’t work correctly on Windows XP Embedded.

On startup it displayed the following message:

I verified that System.Configuration.dll was present (in C:\Windows\Microsoft.NET\Framework\v2.0.50727).

However it not present in the Global Assembly Cache (GAC):

Global Assembly Cache

After registering the dll to the GAC the executable ran fine.

I used the Gacutil utility to register the dll with a script (in my case with HP Device Manager)

Gacutil is only distributed with the Windows SDK and if you only need Gacutil then select only Tools under .NET Development:

image

Gacutil is installed in the following locations:

  • C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools (v4.0.30319.1)
  • C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin (v3.5.30729.1)