I have another function trying to do similar things but a bit simpler, I noticed that by adding this change I started to get exactly the same exception as the first function I referenced earlier:
Before I added this change the function ran however all the Geometry objects (like Lines/Breps/etc) were pushed to the other stream as Base objects (which is sort of expected I guess)
Hi, I am having this same issue. Just going through the SDK guide to send data from the documentation.
Here’s my amazing console application:
using System.Collections.ObjectModel;
using Objects.BuiltElements;
using Speckle.Core.Api;
using Speckle.Core.Credentials;
using Speckle.Core.Models;
using Speckle.Core.Transports;
Base data = new Base();
// Loop from 0 to 9 and create a room with name
Collection<Room> rooms = new Collection<Room>();
for (int i = 0; i < 10; i++)
{
Room room = new Room() {
area = 100 * i,
volume = 1000,
name = "Room " + i
};
}
string projectId = "myProjectId";
var serverInfo = new ServerInfo() { url = "https://myserver.speckle.xyz" };
var account = new Account() { serverInfo = serverInfo, token = "mytoken" };
var client = new Client(account);
var transport = new ServerTransport(account, projectId);
var objectId = await Operations.Send(data, new List<ITransport>() { transport });
Console.WriteLine("Object sent with id: " + objectId);
Googling the issue I discovered the BinaryFormatter is not trusted any longer so its disabled by default in .NET apps. So I had to explicitly enable it like so:
Thanks for the report.
I was semi-aware of this issue, but not aware of this workaround (so kudos!) (or that Microsoft were now prohibiting binary serialization)
I’ll do some investigation our end to see if there’s an alternative to the binary formatter we use for our object hashing.