I tried searching but couldn't find anything to help in my case so I apologize if this has been covered before and I just missed it.
Our application is using the Exception Handling Application Block of the Enterprise Library 4.0 and is being deployed via ClickOnce. In one of our assemblies we have defined a few custom exception handlers which are added with the integrated configuration tool
and referenced by their full type name in the configuration file, ie:
<add type="My.Namespace.MyCustomExceptionHandler, MyAssembly, Version=220.127.116.11, Culture=neutral, PublicKeyToken=MyPublicKey:)"
name="Custom Exception Handler" />
Now everything's working fine under our regular debug/release development builds within Visual Studio. However as part of our ClickOnce deployment the assembly versions are auto-incremented, so when running a deployed version we get the expected exception
"An error occurred creating the configuration section handler for exceptionHandling: Could not load file or assembly 'MyAssembly, Version=18.104.22.168, Culture=neutral, PublicKeyToken=MyPublicKey:)' or one of its dependencies. The located assembly's manifest
definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
because that's not the version it finds under the ClickOnce install. I found that if I remove the ", Version=22.214.171.124" part of the type name everything works fine under our development builds and the ClickOnce deployment builds.
Now for my question... It's of course not ideal to not have a specific version referenced in the config file or to have to go in and remove the version number whenever we modify it with the configuration tool. Does anyone have any suggestions
for elegantly handling this? Or should I just continue removing the version numbers from our configuration? Or maybe just scrap using configuration files and configure the EHAB programmatically?
This is not an entlib issue, more of ClickOnce deployment. Found this thread anyway, might be what you're looking for - http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/bda19fb9-c76b-4c9f-a287-4fe8acd23edb/
Global Technology & Solutions