- Home /
namespace support in unity
Hi, when I tried to use "using System.Windows;" & "using System.Windows.Forms;" in a C# script file, an error occurred says like "Windows does not exist in System" "are you missing an assembly or directive", but it is OK when I use "using System.IO;" for example.
Why?
Although System.Windows.Forms is a name space available in .NET 1.1
What .NET version Unity supports ? and is it a full support?
the issue is that I want to use OpenFileDialog. I tried filebrower by AngryAnt but with errors like "DirectoryInfo in unknown identifier"
Thanks
Edit (clarifications):
Thanks I mentioned that I want to use OpenFileDialog (which belongs to System.Windows.Forms according to MSDN website ),so that this (at runtime) gives the user the ability to browse,for example, his harddisk and choose a file such as an mp3 and play it during the game. I knew that Unity is using Mono framework, However I meant in the question the .net functionality support. I searched in C:\Program Files\Unity\Editor\Data\Frameworks\Mono.framework,found System.Windows.Forms.dll and did not found System.IO.dll.However,no error occurred when using System.IO,but an error occurred when using System.Windows.Forms.dll .
Answer by Michael La Voie · Mar 11, 2010 at 12:39 AM
The .Net framework is windows only and thus Unity opted to go with the open source port of it called the mono framework.
You will not necessarily have access to the same namespaces. Unity currently uses an older version of mono, though they'll be updating to a modern version with unity 3.0 in the summer of 2010. Their current version of mono supports roughly the .net 2.0 level of functionality. The mono framework does have a port of System.Windows.Forms, but Unity may not include it.
What in particular did you need from System.Windows?
It would be nice if Unity actually documented what subset of .NET was supported on the iPhone. Currently it seems to be a process of trial-and-error!
This is a $$anonymous$$onoTouch doc, rather than a Unity doc, but I've found it tremendously useful for iPhone limitations. At the bottom, there's a link to the portion of .NET implemented in $$anonymous$$onoTouch.