spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column109


JScript .NET, Part III: Classes and Namespaces

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Loading Assemblies

When you specify /autoref- at the jsc.exe compilation command, there is no automatic association between namespaces and assemblies. You need to specify the assembly names explicitly. Use the /reference switch to do this. The syntax is simple:

/reference:file[;file2]

Since only one .exe file can be associated with a single application, your assemblies should be .dll files. In any case, when you compile with /target:winexe or /target:exe, do not pass to the /reference switch any assemblies created with /target:winexe or /target:exe.

When you reference an Assembly A which references another assembly (B), you may need to reference Assembly B as well, if Assembly B inherits from Assembly A, or if Assembly A implements an interface from Assembly B.

In order for the compiler to recognize types in an assembly, it needs to resolve these types first. You need to force the compiler to resolve these types by creating instances of these types, or by inheriting from these types.

Here is an example for using the /reference switch:

jsc /reference:metad1.dll;metad2.dll /out:out.exe input.js

The compiler searches for the assembly in the following order:

Here is an example using /lib:

jsc /lib:c:\ /reference:t2.dll t2.js


Next: How to specify member visibility

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: May 6, 2002
Revised: May 6, 2002

URL: http://www.webreference.com/js/column109/5.html