EntLibConfig.exe

The Enterprise Libarary Configuration Tool
 

If you use Microsoft’s Enterprise Libraries at all then you may have seen this tool before…

I found this tool while doing some research on the Enterprise Library entries in an app.config file and realised it could be very useful for the application I was working on. My problem came when I tried loading the app.config file into the EntLibConfig.exe as it reported that one or more errors had occurred during the loading process. The errors I were getting appeared as "…The located assembly’s manifest definition does not match the assembly reference." at the bottom of the screen. The app.config file was valid as my application had been running without any issues.

My search for an answer took me to this page – http://blogs.msdn.com/tomholl/archive/2007/04/19/avoiding-configuration-pitfalls-with-incompatible-copies-of-enterprise-library.aspx – which explained that I was trying to load an app.config file referencing assemblies that were not signed. Taking a look at my entries in the app.config file for the Microsoft.Practices.EnterpriseLibrary  I found that all the PublicKeyToken values were null. Since the EntLibConfig.exe was using signed assemblies this was the reason for the errors.

My next task was to find out what the Public Key Token value was for the Enterprise Library assemblies. For that I used the Strong Name Utility (sn.exe). This link gave me some useful information about using SN.exe – http://blogs.msdn.com/miah/archive/2008/02/19/visual-studio-tip-get-public-key-token-for-a-stong-named-assembly.aspx

Having entered the correct Public Key Token values into the app.config my configuration file now loaded into the EntLibConfig.exe without any errors and I was able to do the necessary editing.

MSBuild Error 5004

MSB5004 Build Error for VS2008 Solution
 

During an automated build process I came across an error that MSBuild had thrown – ‘Error parsing the nested project section in solution file’. The problem stems from a change to a GUID for one of the Nested Projects within the Solution File. When comparing a Solution File for a successful build to the failed build I found the GUID had changed. To rectify the error I added a blank text file to the solution, saved the changes to the solution file, removed the text file and re-saved the solution file. This resolved the issues as the next build was successful.

GAC & ZAP

Whats the difference between GAC and ZAP?.
 

The GAC holds assemblies installed on the local host that are available for shared use by other code. The Zap Cache is a sub-cache of the GAC that holds assemblies that have been precompiled into native machine code. Zap Cache assemblies are typically Fully Trusted libraries that are used frequently by the CLR itself, so precompilation boosts performance.

If you would like to know more, take a look at http://www.nsa.gov/ia/_files/app/oldFiles/NET_Framework_Sec1.pdf

Unable to find manifest certificate in the certificate store

Addind a Strong Name Key file to an existing project .
 
Whilst trying to add a Strong Name Key file (.snk) to an existing Visual Studio 2008 project I came across this error – Unable to find manifest certificate in the certificate store. Since this was the first time that I had tried adding a key file to the project I couldnt understand why it wasn’t letting me do it? It turns out that someone else had previously been experimenting with Signed Assemblies and there were some entries in the .csproj file that were left over:
 
<manifestcertificatethumbprint>…</manifestcertificatethumbprint>
<manifestkeyfile>…</manifestkeyfile>
<generatemanifests>…</generatemanifests>
<signmanifests>…</signmanifests>
 
After I removed these lines and reloaded the project within Visual Studio I was able to add my Strong Name Key file without any further issues.
 
 

VS 2005 SP1 Installation Problem

"The installation source for this product is not available."
 
I recently had to install VS 2005 SP1 on a Windows 2003 server that was hosting a development environment. After firing up the setup process I was presented with this error message on my screen;
 

                                       Capture

Looking in the Event Log I also found this entry around the time the error message was generated;

Event Type:Error
Event Source:MsiInstaller
Event Category:None
Event ID:1008
Date:12/18/2006
Time:12:18:31 PM

Description:
The installation of C:DOCUME~1…LOCALS~1TempZNWA0VS80sp1-KB926601-X86-ENU.msp is not permitted due to an error in software restriction policy processing. The object cannot be trusted.

After doing a bit of research I came across others who had experienced the same problem and they directed me to this Knowledge Base artcile http://support.microsoft.com/default.aspx/kb/925336 which provided the solution. After applying the update and rebooting the server I was able to install the Service Pack.

Express yourself clearly

Useful little tool for Regular Expressions
 
If you are like me and cannot remember the correct syntaxt for every every single Regular Expression I have come across a useful little tool to give you a hand. The Regular Expression Designer from Rad Software http://www.radsoftware.com.au/regexdesigner/ is very easy to use and best of all its free! Now you can debug your Regular Expressions without even stepping into your code.

Mutually exclusive development errors

The old ‘Mutex could not be created’ error
 
I have been doing some development in a new Visual Studio 2008 environment and was trying to debug my web service that I had created. As this was a new environment some of the security settings needed to be configured to allow me to run in DEBUG mode. After settings these permissons and starting my web service again I was still getting debug errors so I browsed the ASMX file from within IIS and got a ‘Mutex could not be created’ error within IE.
 
As with most of these errors I am not the first person to encounter the problem but I thought it was worth mentioning that this solution worked for me;
  • Close down all open Visual Studio IDE’s
  • Go to the ASP.NET Temporary folder for the version of the framework under which your application pool is running. For my web service running as a ASP.NET 2.0 application this is located at <%systemroot%>Microsoft.NetFrameworkv2.0.50727Temporary ASP.NET Files.
  • Delete the folder for your application.
  • Reset IIS
  • Check that you can now browse to your page, or web service, using IE.
  • Then reopen your solution within the development environment.

Problem solved! No more Mutex errors and I could debug my web service in my development enviroment. If you are interested, there is a useful Wikipedia article on Mutual Exclusion.