- Home /
The question is answered, right answer was accepted
unity could not load from assembly [resolved]
Hi,for one of my projects I need to reference System.Drawing.dll in Windows, so I copied it into the Asset folder. Now I keep on getting the following Exception when I compile and run the game.
TypeLoadException: Could not load type 'System.IO.InternalBufferOverflowException' from assembly 'System.Drawing'
What could it be I'm doing wrong?
@gjf the exception only shows in the development console, the editor uses the dll just fine.
this executes (admittedly it doesn't really do anything):
using UnityEngine;
public class DrawTest : $$anonymous$$onoBehaviour
{
public void Start ()
{
var newImage = new System.Drawing.Bitmap(64, 64);
}
}
i needed to copy the dll into the same folder as the script, but no errors.
EDIT: you did copy the mono version and not the windows one, right?
mono's .net is the one unity uses so you're likely to get all sorts of unpredictable behaviour using the dll's from windows. sadly, the mono version is rather dated right now, but the drawing stuff that i've used works well enough.
@gjf You were right, with mono I'm not getting any errors at all. Unfortunately I'd really need them because now it's doing absolutely nothing :D But that is another issue entirely. Thank you for helping me, I really appreciate the guidance !
Follow this Question
Related Questions
Error initializing license system (Windows 8.1) 0 Answers
How to set WindowStyle (hide MINIMIZE and MAXIMIZE buttons) 0 Answers
Accessing local system ( File Browser ) 2 Answers
Creating a Directory in "My Documents" 2 Answers
IOException build error 1 Answer