Intel® Software Network Knowledge Base Wiki


Constructing Nav Tree
One Moment...

(refresh menu)



 
Welcome, Guest | Quick Login | Register

.NET


How to Share and Reference .NET Assemblies

Version 7, Changed by KEVIN PIRKL on 1/2/2008
Created by: KYLEX.S.LEWIS@INTEL.COM
Challenge
 
Translate working sets of .class files into assemblies or combine .NET assemblies and Java .class files into a .NET executable or assembly. Assemblies are useful because they can be shared and are loaded on demand by the Common Language Runtime (CLR)*.

 
Solution
 
Use the Jblmp utility (the default J#* installation installs JbImp into the C:\Program Files\Microsoft Visual J# .NET\Framework\Bin folder. You need to ensure that this folder is on your PATH).

Any application or assembly running under the CLR can contain references to assemblies created using JbImp, making it feasible, for example, for a C# application to call code that was originally developed and compiled using the JDK. The following command converts four of the five .class files that were created in the separate item, "How to Convert Java .class Files to .NET Executables" into an assembly (note that you use the /target:library option to create an assembly):

 
jbimp /target:library /out:DotNetGui.dll GuiApplication.class
   GuiApplication$1.classGuiApplication$OnMouseEnteredHandler.class
   GuiApplication$OnMouseExitedHandler.class

 
JbImp also allows you to combine .NET assemblies and Java .class files into a .NET executable or assembly; use JbImp's /r option to reference the assemblies (make sure the name of the executable is different from the name of any referenced assembly). Notice that assemblies referenced by JbImp do not have to be created using JbImp, which allows an application originally written in Java* to make use of code written in other languages running under .NET. For example:
jbimp /target:exe /out:SecondDotNetApplication.exe 
r:DotNetGui.dll GuiApplicationLauncher.class

 
Using the IL DASM tool to analyze a .NET executable and identify dependencies upon other assemblies is covered in a separate item, "How to Inspect the Internal Structure of a .NET* Executable."

 
Source
 


Served
23 Knowledge Bases
604 Pages
Search
Powering Up Search...


Vote on this Page

Tags For This Page
Loading Tags..

Tag This



Additional legal information