My problem is the following. As I need to use System.Windows.Form namespace for Windows dialogs I first tried to use normal “Edit Reference” in MonoDevelop, search for the .dll in …\Unity\Editor\Data\Mono\lib\2.0 and just adding it. This caused a problem because as I had algo as reference System, when I write using System.Windows.Form and then build the solution, it tells me that it didn’t found ‘Windows’ in ‘System’ namespace. This is obvious because it didn’t had to lookup there. So I solved it in mono by adding “/reference:WinForm=<DLL_PATH>” in compiler additional arguments and in my class heading:
extern alias WinForm.
When I needed to use a namespace from that import I write for example:
WinForm::System.Windows.Forms.SaveFileDialog saveDialog = new WinForm::System.Windows.Forms.SaveFileDialog();
saveDialog.FileName = Path.GetFileName(myPathVar);
My problem now is that I can’t access the compiler arguments in Unity. Error: Assets/scripts/GenerateFiles.cs(1,14): error CS0430: The extern alias `WinForm’ was not specified in -reference option, where do I put -reference??
I have tried:
Unity.exe -batchmode -buildWindowsPlayer “PATH.TO.EXE.exe” -reference:WinForm=“C:\Program Files (x86)\Unity\Editor\Data\Mono\lib
\mono\2.0\System.Windows.Forms.dll” but it ain’t working =S.
Thanks in advance.