
DOCUMENT TYPE | Title Here .NET Assemblies in Gupta TD 6 OpenText Gupta Team Developer Abstract Microsoft .NET is a Framework supporting multiple language allowing those languages to exchange code and can be referred as interoperability. An application that uses the .NET Framework, a large library of class will be able to consume an amazing collection of features through .NET assemblies. Assemblies are collections of compiled objects directly deployable supporting versioning, security and much more. WHITEPAPER | .NET Assemblies in Gupta TD 6 Table of Contents Overview ........................................................................................................... 3 What is a .NET assembly? ................................................................................ 3 Building blocks ............................................................................................... 3 .NET runtime Versus OpenText Gupta Team Developer runtime.................. 4 Advantage using .NET assemblies ................................................................ 4 .NET Assemblies features ............................................................................. 4 Global Assembly cache ..................................................................................... 4 Location of the GAC ...................................................................................... 5 .NET Framework command line tools to manage the GAC ........................... 6 Strong name and Registration process ............................................................. 6 Strong name key generation.......................................................................... 7 Linking keys to .NET assemblies ................................................................... 7 Installing the assembly on the GAC ............................................................... 7 Overview Consuming .NET assemblies in OpenText GuptaTeam Developer .. 8 .NET explorer Wizard overview ..................................................................... 8 .NET explorer generated interface ............................................................... 10 .NET generated interface and dependencies .............................................. 10 Consuming .NET core features ....................................................................... 11 Win32 SDK versus .NET Base class library (BLC) ...................................... 11 File Information Sample ............................................................................... 11 .NET assemblies versus Opentext Gupta Team Developer external calls .. 16 Constructor, Collection, enumeration, properties ............................................ 17 A word about .NET security and OpenText Gupta Team Developer ............... 21 Public access modifier and the __exported pragma .................................... 21 .NET exceptions versus OpenText Gupta Team Developer error handling .... 23 Exceptions in OpenText Gupta Team Developer .NET target consuming assemblies ............................................. 23 Current limitations ........................................................................................... 23 Conclusion ...................................................................................................... 24 About OpenText .................................................................................................................................................... 25 O P E N T E X T G U P T A T E A M D E V E L O P E R 2 WHITEPAPER | .NET Assemblies in Gupta TD 6 Overview OpenText Gupta Team Developer now supports .NET! This unleashes tremendous power and flexibility, allowing you to create rich GUI application and more: You can now create a WPF application directly in Team Developer using SAL. See: Creating a .Net WPF application from scratch You can also consume WPF controls. See: WPF Container and Controls in TD 6.0 You can create specific SAL .NET Libraries, assemblies allowing you to export class and GUI components to other .NET Team Developer applications: Migrating apps which use Dynalibs Finally, you can create and consume non visual .NET assemblies in Team Developer 6.0 allowing you to use the richness of the .Net Framework library. Use custom compiled assemblies produced with different language such as VB, C# and of course Team Developer 6.0 allowing you to share your work to the growing .NET community. This is what this document will cover. What is a .NET assembly? It is the building blocks of .NET Framework applications. A .NET assembly is an output unit of code that a specialized runtime (CLR) executes in a managed way. This might be vague to you, so let’s try to make some analogies to what we know well and then get to the details and differences: Building blocks In a very basic way you could compare it to the building blocks of a Gupta Team Developer application: Were you might call External function to a DLL to consume certain features of the Windows API. Sal API calls to the Gupta Team Developer runtime for the User Interface and SQL access and so on. Then you might eventually create Gupta Team Developer modules using Dynalibs or COM object to encapsulate your business logic for sharing and re-use at a binary level as opposed to source level when using application libraries APLs. The common point of all this is that Gupta Team Developer .EXE application as well as Dynalibs and COM Objects contains code written in SAL. This code gets interpreted and executed by the Team Developer Runtime CDLLIxx.DLL. In a word the Gupta Team Developer runtime interprets and manages the execution of your Gupta Team developer application. When you are building a .NET Framework application .EXE or modules .DLL, with C# or Team Developer the output language contained in the .NET assembly is called the Common Intermediate Language (CIL). O P E N T E X T G U P T A T E A M D E V E L O P E R 3 WHITEPAPER | .NET Assemblies in Gupta TD 6 It gets compiled into the machine language at run-time by the Common Language Runtime (CLR) just-in- time-compiler (JIT), to finally run in a virtual machine. The CLR is an execution engine and is managing at this point your .NET application or assemblies, i.e.: Garbage collection. .NET runtime Versus OpenText Gupta Team Developer runtime The important differences here with a Win32 Team Developer application .EXE or APD/COM apart the intermediate language (IL) versus SAL is the CLR and the JIT compiler. As you understood, you no longer use the Team Developer runtime but use the .NET one when doing a Team Developer WPF application or class. The CRL/JIT will compile dynamically CIL to the machine code maximizing it for performance by caching compiled code. The virtual machine being plate-form agnostic allows in principle the execution of your code on any plate-form supporting the .NET framework. Advantage using .NET assemblies The advantage beyond the Virtual machine is that .NET assemblies as well as .NET application since they are also assemblies should perform faster compared to Team Developer runtime execution thanks to the JIT compiler. Other advantage is that Microsoft Operating system ships with the .NET framework already deployed, i.e.: Windows 7 and the .NET framework 3.5 hence ease of deployment. .NET Assemblies features The comparison really stops here even compared to COM that deals also about versioning. With .NET you will enter a new world full of rich features, beyond the programming tasks and the runtime aspects describe above as .NET assemblies supports: Security defined through policies Name spaces and scope Reference and dependencies through manifest meta-data Versioning through manifest Deployment aspect Side-by-side execution for multiple versions of assemblies on the same machine. As stated assemblies are the building blocks of .NET Framework application hence the topic is vast, please for detailed information consult: http://msdn.microsoft.com/en-us/library/k3677y81%28v=VS.71%29.aspx Global Assembly cache For the support of some of these feature mentioned previously, the .NET Framework manages a repository of assemblies: O P E N T E X T G U P T A T E A M D E V E L O P E R 4 WHITEPAPER | .NET Assemblies in Gupta TD 6 The Global Assembly Cache or GAC is the global machine .NET assembly cache for the Common Language Runtime (CLR). It is a central repository for sharing libraries that supports Versioning, side by side execution in a word allows for better code sharing and functionalities without common issues found in simple DLL interface: conflict of versions when there are multiple DLL of the same name on the machine. .NET achieves this using strong name for assemblies. In some way similar to COM object and its registration process in the registry. Location of the GAC The repository is generally located in %windir%\assembly\ directory but can be relocated if needed. System.Xml in the machine GAC viewed by the explorer As you can see this does not look like a classic file system viewed from the explorer. If you right click on an assembly name you can’t delete it, but you can un-install it or watch its property. You can also install a signed strong name assembly directly in the repository using drag and drop. Trying to drag and drop a non-signed assembly to the GAC in order to install it results in: O P E N T E X T G U P T A T E A M D E V E L O P E R 5 WHITEPAPER | .NET Assemblies in Gupta TD 6 .NET Framework command line tools to manage the GAC Additionally the .NET framework provides command line
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages25 Page
-
File Size-