[Mono-devel-list] PrivateBinPath, serialization and pinvoke bug...

Vadim B. Guzev vguzev at yandex.ru
Fri Jan 30 10:56:18 EST 2004


Hello, mono-devel-list at lists.ximian.com!


The example attached works fine on Mono 0.28 and 0.29, but no longer works
in mono-0.30-1.20040129.

It seems to me that this bug is connected with the PrivateBinPath variable.
When deserializing some object mono doesn't check for assemblies in
PrivateBinPath. Although it can check now only relative paths...

To compile and launch this example you should to do the following:
1. Unzip archive to folder for example in '/path/'
2. Change the variable 'folder' in file '/path/pinvokecomplex/amcsharp.cs'
in class AppDomainController method Test to actual location
3. Run 'make'
4. cd /path/Temp/; mono Test.exe
This will create the file '/path/Temp/serializedobject.txt' with serialized
object saved inside.
5. cd /path/pinvokecomplex/; mono TestPInvoke.exe

This program will deserialize object from txt-file and try to launch some
method of this object.
This will throw the following exception:
8<----------------------------------------------------------
3:System.IO.FileNotFoundException: File 'Test, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null' not found.
in (unmanaged)
/local/users_shared/vadim/mono/mono-0.30-1.20040129/lib/libmono.so.0(mono_ra
ise_exception+0x1f) [0x4008b74f]
in (unmanaged)
/local/users_shared/vadim/mono/mono-0.30-1.20040129/lib/libmono.so.0
[0x400b1256]
in <0x0006c> (wrapper remoting-invoke-with-check)
System.AppDomain:LoadAssembly (string,System.Security.Policy.Evidence)
in <0x0006b> System.AppDomain:Load (string)
in <0x00058> (wrapper remoting-invoke-with-check) System.AppDomain:Load
(string)
in <0x0001c> System.Reflection.Assembly:Load (string)
in <0x00077>
System.Runtime.Serialization.Formatters.Binary.ObjectReader:GetDeserializati
onType (long,string)
in <0x0024b>
System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadTypeMetadata
(System.IO.BinaryReader,bool)
in <0x00048>
System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadObjectInstan
ce
(System.IO.BinaryReader,bool,long&,object&,System.Runtime.Serialization.Seri
alizationInfo&)
in <0x00095>
System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadObject
(System.Runtime.Serialization.Formatters.Binary.BinaryElement,System.IO.Bina
ryReader,long&,object&,System.Runtime.Serialization.SerializationInfo&)
in <0x00086>
System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadNextObject
(System.IO.BinaryReader)
in <0x000b6>
System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadObjectGraph
(System.IO.BinaryReader,bool,object&,System.Runtime.Remoting.Messaging.Heade
r[]&)
in <0x001b0>
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Deserialize
(System.IO.Stream,System.Runtime.Remoting.Messaging.HeaderHandler)
in <0x00019>
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Deserialize
(System.IO.Stream)
in <0x00093> aMCSharp.AppDomainProcessor:CallMethod (string)

8<----------------------------------------------------------

Is there any way to solve this problem?


Best regards,
Vadim B. Guzev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pinvokeandserialization.zip
Type: application/x-zip-compressed
Size: 10404 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040130/f3aa880a/attachment.bin 


More information about the Mono-devel-list mailing list