You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ATM, using the visualizer against a .NET Core project fails, with the following stack trace:
An unhandled exception of type 'System.TypeLoadException' was thrown by the custom visualizer component in the process being debugged.
Could not load type 'System.Runtime.CompilerServices.IsReadOnlyAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
wtih the following stack trace:
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)
at System.Reflection.CustomAttribute.IsDefined(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
at System.Runtime.Serialization.SerializationEvents.GetMethodsWithAttribute(Type attribute, Type t)
at System.Runtime.Serialization.SerializationEvents..ctor(Type t)
at System.Runtime.Serialization.SerializationEventsCache.<>c.<GetSerializationEventsForType>b__1_0(Type type)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at System.Runtime.Serialization.SerializationEventsCache.GetSerializationEventsForType(Type t)
at System.Runtime.Serialization.SerializationObjectManager.RegisterObject(Object obj)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteArrayMember(WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, Object data)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteArray(WriteObjectInfo objectInfo, NameInfo memberNameInfo, WriteObjectInfo memberObjectInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, BinaryFormatterWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Boolean check)
at ExpressionTreeVisualizer.VisualizerDataObjectSource.TransferData(Object target, Stream incomingData, Stream outgoingData) in C:\Users\Spitz\source\repos\zspitz\ExpressionToString\Visualizer.Shared\VisualizerDataObjectSource.cs:line 9
at Microsoft.VisualStudio.DebuggerVisualizers.DebuggeeSide.Impl.ClrCustomVisualizerDebuggeeHost.TransferData(Object visualizedObject, Byte[] uiSideData)
I've managed to isolate the problem outside of the context of the visualizer:
// using System;// using System.IO;// using System.Runtime.Serialization.Formatters.Binary;varstream= File.Create(Path.GetTempFileName());varformatter=new BinaryFormatter();vardata=new VisualizerData(expr);// serialized class with information about a given expression tree
formatter.Serialize(stream, data);// fails with the same exception
but only if there is a reference to the visualizer DLL project, and VisualizerData comes from there.
If I copy VisualizerData.cs to the .NET Core project and use that, without a reference to the visualizer DLL, the serialization works fine.
A possible workaround might be to move VisualizerData to the Shared project, as it doesn't have any dependencies on the visualizer DLL.
The text was updated successfully, but these errors were encountered:
But since .NET Framework will never be adapted to match a later version of .NET Standard (>2), as long as Visual Studio runs on ,NET Framework, we'll never be able to use auto-implemented properties.
ATM, using the visualizer against a .NET Core project fails, with the following stack trace:
wtih the following stack trace:
I've managed to isolate the problem outside of the context of the visualizer:
but only if there is a reference to the visualizer DLL project, and
VisualizerData
comes from there.If I copy
VisualizerData.cs
to the .NET Core project and use that, without a reference to the visualizer DLL, the serialization works fine.A possible workaround might be to move VisualizerData to the Shared project, as it doesn't have any dependencies on the visualizer DLL.
The text was updated successfully, but these errors were encountered: