我的代码库主要在.net框架中。我试图通过python.net. 我能让它成功运行
npython.exe MyPythonScript.py
一切如期进行。在
但是,如果不使用我的npython版本,而是使用pip在我的anaconda python中直接安装pythonnet包,然后尝试运行C:\Anaconda3\python MyPythonScript.py
这样的脚本,我会得到如下错误
The deserializer cannot load the type to deserialize because type 'System.Collections.Generic.List`1[[RefData.LookUpDataItem, RefData, Version=1.0.6841.27933, Culture=neutral, PublicKeyToken=null]]' could not be found in assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Check that the type being serialized has the same contract as the type being deserialized and the same assembly is used.
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns)
at System.Runtime.Serialization.NetDataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
at Microsoft.ApplicationServer.Caching.Utility.Deserialize(Byte[][] buffers, Boolean checkTypeToLoad, Object context, IEnumerable`1 knownTypes)
at Microsoft.ApplicationServer.Caching.RoutingClient.SendMsgAndWait(RequestBody reqMsg, IRequestTracker& tracker)
at Microsoft.ApplicationServer.Caching.DataCache.SendReceive(RequestBody reqMsg, IMonitoringListener listener)
at Microsoft.ApplicationServer.Caching.DataCache.InternalGet(String key, DataCacheItemVersion& version, String region, IMonitoringListener listener)
at Microsoft.ApplicationServer.Caching.DataCache.<>c__DisplayClass49.<Get>b__48()
该程序从Microsoft AppFabric缓存服务器检索一些数据。缓存DLL位于同一位置。我的库dll或使用它们的python脚本没有任何更改。只是不同的召唤。在
在anancodapython3.6安装和独立的python2.7安装中也可以观察到相同的行为。这是完全不可能的吗?还是有什么特定的缓存和序列化导致了这些问题?如果有任何帮助,我们将不胜感激。在
目前没有回答
相关问题 更多 >
编程相关推荐