References In Visual Studio

From RemObjects Software

Jump to: navigation, search

This is a Oxygene How To entry
Feel free to add your notes to this topic below.

The way you access code outside your current project is quite different in Oxygene from what you might be used in Delphi (which refers to native Delphi in this article).
In Delphi you have a global search path. This is where the compiler will go and search for any unit, that is used by your code but is neither in your project, nor in the projects search paths.
Oxygene, like all (most?) native languages inside VS, does not have anything like a search path to resolve namespaces.
You can reference other projects or plain managed assemblies, and the compiler knows every type (and by that all namespaces) that is available to your project.
Image:Image-Chrome-VS2008References1.png
You can point to source files, that reside outside your project, without copying them into it. This is done simply by clicking on that little arrow in the "Add existing item" dialog's add button. There you can choose "add as link".
Image:Add as Link.png

Wildly referencing source files will probably undermine your efforts of version controlled source handling. Thus, reusing either pre-built assemblies or projects is the better way to go.
Oxygene can use project references even if they are not part of the solution. This is great if you want to use different versions of a library, and Oxygene will pick the last-built binary automatically.

There is no ambiguousness of units that you probably have encountered in Delphi. Where different version of the same units can be in the search path and the compiler might pick a different one than you wanted him to.
External referenced code in Oxygene is basically WYSIWYG. There are only very few cases in which you may not be able to directly see where the code is coming from. e.g.: References to assemblies in the GAC.

Also, always keep in mind that Oxygene has no "units". A source file in Oxygene is just that: a source file. It comes with no association with either type name or namespace.


Product: RemObjects Oxygene (formerly known as Chrome)
Current version: 3.0 Previous Versions: 'Joyride' (2.0), 'Floorshow' (1.5), 'Adrenochrome' (1.0)

GlossaryKeywordsLanguage FeaturesPlatform FeaturesSamplesArticlesHow ToIssues

Personal tools