Last week, when trying to convert an application from .NET 1.1 to .NET 2.0, I ran into an issue with loading an assembly in GAC using reflection. We used to be able to call Assembly.Load(“assemblyName”) to load it. Now we received an exception saying "File or assembly name ... or one of its dependencies, was not found". It turned out that in .NET 2.0, if the assembly is in GAC, you have to specify the full name of the assembly in above method. That includes version number, public key and culture. You may use LoadWithPartialName() method. But it is obsolete in 2.0 and later.
No comments:
Post a Comment