Professional Documents
Culture Documents
First check your existing Visual Studio project for E20xx and make sure of the following:
1. Make sure you are not using “Any CPU” configurations; E20xx projects should only use “x86”.
2. Make sure you are not using COM references for ESPRIT; only .NET Interop.Esprit*.dll references should
be used for ESPRIT projects.
3. Absolute HintPaths are strongly recommended for ESPRIT references. Visual Studio uses relative
HintPaths by default though, so you must open the .csproj or .vbproj project file in a text editor to check
and change these. You can also set ReferencePaths in the project properties Visual Studio, which by
default typically creates a .csproj.user or .vbproj.user file, although the information in the .user file can
also be manually inserted into the project file instead.
#if (TNG)
foreach (Esprit.PartOperation op in Document.PartOperations)
#else
foreach (Esprit.Operation op in Document.Operations)
#endif
In VB.NET:
5. When creating a TNG Extension from an E20xx add-in one more place that you will need to use the TNG
symbol/constant and conditional compiler directives is with the Imports statements and attributes in
the “connecting” class (typically called Connect in Connect.cs or Connect.vb code file). The attributes
that must be applied to TNG extensions are completely different from the attributes applied to E20xx
add-ins and they come from different imported DLLs and namespaces. In C#:
#if (TNG) // must add corresponding References for these two using statements
using ESPRIT.NetApi.Extensions;
using System.ComponentModel.Composition;
#else
using System.Runtime.InteropServices;
#endif
#if (TNG)
[Export(typeof(IExtension)), ExportMetadata("SupportBuild", 20)]
public class Connect : DPTechnology.AnnexLibraries.EspritAddIn
#else
[ClassInterface(ClassInterfaceType.None), ComVisible(true),
Guid("5b0109b1-f251-4968-8b4f-6896d0704dd1"),
ProgId("E20xxSampleAddIn.Connect")]
public class Connect : DPTechnology.AnnexLibraries.EspritAddIn
#endif
In VB.NET:
#If TNG Then ' must add corresponding References for these two Imports statements
Imports ESPRIT.NetApi.Extensions
Imports System.ComponentModel.Composition
#Else
Imports System.Runtime.InteropServices
#End If