RE: AssemblyResolve callback never called in .NET 2.0
- From: Daniel PS <DanielPS@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Jun 2005 05:45:04 -0700
Hi Matt,
I have exactly the same problem, but it has nothing to do with versioning.
When you serialize an object, the runtime writes the assemby information to
the stream. If these assemblies were loaded from other directories than the
main directory you have a problem with deserialization. I solved the problem
in 1.1 with appending all folders of my plugin assemblies
(AppDomain.CurrentDomain.AppendPrivateBinPath).
This will help you for now. The very bad thing about this solution is, that
it will not work with the .Net 2.0 final, because the Method is marked as
deprecated.
Instead of using this method you are supposed to use
AppDomain.CurrentDomain.SetupInformation.PriateBinPath.
The only drawback about that is you can't use this way for the
DefaultAppDomain.
"Matt Zinkevicius" wrote:
> Hi,
> We have a product written in C# that we are migrating to Visual Studio 2005
> (beta 2) and .NET 2.0. Everything builds fine, but during runtime we are
> hitting a new exception. When it is deserializing a some classes from disk
> that were serialized with the .NET 1.1 version, we are now getting a
> SerializationException() saying that it can't find our assembly. Our
> assemblies are strongly-named, and we bump the assembly version in each
> build, so we already dealt with this problem earlier by writing a
> AppDomain.AssemblyResolve event handler which returns the correct assemblies.
> The problem is that with .NET 2.0 our handler is no longer being invoked! Is
> this a known issue with a known workaround? Is there another way to avoiding
> this versioning problem with serialization in .NET 2.0?
>
> --Matt Zinkevicius
.
- Follow-Ups:
- RE: AssemblyResolve callback never called in .NET 2.0
- From: Richard Blewett [DevelopMentor]
- RE: AssemblyResolve callback never called in .NET 2.0
- Prev by Date: Re: CLR Deadlock?
- Next by Date: Re: Serious regression: Win2K3 SP1 kills Timers
- Previous by thread: Serious regression: Win2K3 SP1 kills Timers
- Next by thread: RE: AssemblyResolve callback never called in .NET 2.0
- Index(es):
Relevant Pages
|