- Home /
TypeLoadException: System.Security.Authentication.ExtendedProtection.ChannelBinding
I am building a project that uses a custom C# DLL I wrote.
At some point during development, this error popped up and I didn't understand it - I never make use of anything like ChannelBinding
. It still makes my game run from the Editor, but I cannot build it anymore.
I have looked through all References in the VS Solution Explorer and I did find System.Security
added to my project. I removed it, but to no avail. Unity still breaks on this particular type, and I don't know what it wants with it.
I've also tried manually adding that particular .NET assembly to the project, but the error remains. What gives?
Answer by mucco · Jun 17, 2018 at 04:47 AM
I solved it. Posting solution for posterity.
The problem arose with the AWS GameLift DLLs I was using. You need to compile their own solution, then place the DLLs in the Plugins folder. Then, you need to set the Unity compatibility setting. I did not do this, or what I did got reverted somehow.
From AWS pages: "Check the API compatibility setting. In the Unity Editor, go to File, Build Settings, Player Settings. In the Other Settings section, under Optimization, make sure that the API compatibility level is set to .Net 2.0."
This solved it for me.
Your answer

Follow this Question
Related Questions
Editor throws TypeLoadException during build 2 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
How can I stop the variable values reverting to its default values after being built? 1 Answer
Someone in 2022 is having trouble with unity build and your anitvirus? 1 Answer