Namespaces, Assemblies, References

These three concepts are new for anyone that comes from VO.

An application can use code that is located in the application itself, or it can use code from other assemblies. An assembly is simply a DLL (the concept of an entirely linked library as in VO does not exists anymore). Such an assembly can be:

Please note that your referenced assembly could need other assemblies, either from the GAC or from another location.

All code in assemblies, included in your own executable, is organized in namespaces. To be found, you need to either define the complete path included the namespace, like in

System.IO.File.WriteAllText( "c:\temp\HelloWorld.txt", "Hello World" )

or to include the needed namespace at the top of your source code, and then use the class directly:

using System.IO
.....
File.WriteAllText( "c:\temp\HelloWorld.txt", "Hello World" )

If you use your own assemblies, you should look at the sources, but if it is either a .NET Framework assembly or a 3rd party assembly, please look at the documentation. For the File class, the MSDN says:

Namespace:   System.IO
Assembly:  mscorlib (in mscorlib.dll)

So to use the File class, you have to check two things:

To make it easier for people migrating from VO the development team has added a special mechanism to the X# compiler (this was available also in the Vulcan compiler): an assembly can add an attribute that lists namespaces that should be treated as “implicit”. And there is a compiler option that instructs the compiler to automatically add these “implicit namespaces” as using statements to your code. The XPorter automatically enables this option, so you can still use classes like DbServer and DataWindow without including using statements for these classes. Vn2Ado also uses this mechanism. If you enable this option then you can use the Ado.. classes without extra using statement.