我在尝试从控制台托管端点使用NServiceBus DataBus时遇到此问题
Type 'NServiceBus.DataBusProperty`1[System.Byte[]]' implements ISerializable but cannot be serialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data.
To fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true.
Path ''.
相同的代码可从网络应用程序正常运行。将一次安全设置设置为完全信任将导致调试问题