spacer

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

home / experts / javascript / column109


JScript .NET, Part III: Classes and Namespaces

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

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, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


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