Compile errors using WebGl plattform

Hi,

I want to add WebGl plattform support for my project and just struggle with the following errors compiling in WebGl on Unity 5.0.0f4. Maybe you have some ideas fixing those. Especially what dll’s work with WebGl and which won’t. Thank’s in advance!

Best,
Andre

Failed running C:\Program Files\Unity 5.0.0f4\Editor\Data\Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed" -l none -c link -x "C:\Program Files\Unity 5.0.0f4\Editor\Data\Tools

ative_link.xml" -f “C:\Program Files\Unity 5.0.0f4\Editor\Data\il2cpp\LinkerDescriptors” -x “D:\Unity Projects\Chatbot_WebGL/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml” -d “D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed” -a “D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll” -a “D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll” -a “D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed\Jurassic.dll” -a “D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed\System.Drawing.dll”

stdout:
Fatal error in Mono CIL Linker
System.Exception: Error processing method: 'System.Void System.Drawing.GDIPlus::CheckStatus(System.Drawing.Status)' in assembly: 'System.Drawing.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void System.IO.InternalBufferOverflowException::.ctor(System.String)
  at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.Process () [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Driver.Run () [0x00000] in <filename unknown>:0 
  at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver) [0x00000] in <filename unknown>:0 
stderr:

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:66)
UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:192)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String, String&, String&, String, String, IEnumerable`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:185)
UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:136)
UnityEditorInternal.AssemblyStripper:Strip(String[], String[], String, String, String&, String&, String, String, IEnumerable`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:121)
UnityEditorInternal.IL2CPPBuilder:RunAssemblyStripper(IEnumerable, String, String[], String[], String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:431)
UnityEditorInternal.IL2CPPBuilder:StripAssemblies(String[], String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:419)
UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:273)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:218)
UnityEditor.HostView:OnGUI()

5.0.0 is old! WebGL export is still very much a bleeding-edge feature, so if you want to use it you should always be running the latest version.

Okay, I found the answer:

You need to set Api Compatibility Level to .Net 2.0. And you need to use Unity 5.2.0f3 upwards. This fixes all errors.

Thanks alot!

Best,
Andre