We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Deployment

Hi I'm trying to create a Windows Installation file which will deploy the ngen images of Syncfusion.Grid.dll etc. I have succeeded in getting the ngen images to install, however I have a question... Is the native image installed in the GAC or should the dll be separately installed in the GAC using gacutil.exe as well as creating the ngen image? After installation I can see the dll (native image) in c:\windows\assembly - does this mean its in the GAC? The following code works fine installing the ngen, but fails with file not found on the gacutil lines: Imports System.Runtime.InteropServices Imports System.Text Imports System.ComponentModel Imports System.Configuration.Install Imports AmberwoodShared Imports System.Windows.Forms Public Class InstallClass Inherits System.Configuration.Install.Installer #Region " Component Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Component Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Installer overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Component Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Component Designer 'It can be modified using the Component Designer. 'Do not modify it using the code editor. Private Sub InitializeComponent() components = New System.ComponentModel.Container End Sub #End Region Private Declare Function GetCORSystemDirectory Lib "mscoree.dll" ( _ ByVal Buffer As System.Text.StringBuilder, _ ByVal BufferLength As Integer, _ ByRef Length As Integer) As Integer Public Overrides Sub Install(ByVal savedState As System.Collections.IDictionary) MyBase.Install(savedState) Dim s As String For Each arg As String In Me.GetArgs s &= Me.GetCorSystemPath & "ngen.exe" & " " & Chr(34) & arg & Chr(34) & vbCrLf & _ Me.GetSystemPath & "gacutil.exe /i " & " " & Chr(34) & arg & Chr(34) & vbCrLf Next MessageBox.Show(s) For Each arg As String In Me.GetArgs Me.ProcessStart(Me.GetCorSystemPath & "ngen.exe", Chr(34) & arg & Chr(34)) Me.ProcessStart(Me.GetSystemPath & "gacutil.exe /i ", Chr(34) & arg & Chr(34)) Next End Sub Public Overrides Sub Uninstall(ByVal savedState As System.Collections.IDictionary) MyBase.Uninstall(savedState) For Each arg As String In Me.GetArgs Me.ProcessStart(Me.GetCorSystemPath & "ngen.exe", Chr(34) & arg & Chr(34) & " /delete") Me.ProcessStart(Me.GetSystemPath & "gacutil.exe /ungen ", Chr(34) & arg & Chr(34)) Next End Sub Public Overrides Sub Rollback(ByVal savedState As System.Collections.IDictionary) MyBase.Rollback(savedState) For Each arg As String In Me.GetArgs Me.ProcessStart(Me.GetCorSystemPath & "ngen.exe", Chr(34) & arg & Chr(34) & " /delete") Me.ProcessStart(Me.GetSystemPath & "gacutil.exe /ungen ", Chr(34) & arg & Chr(34)) Next End Sub Private Function GetArgs() As String() Dim Args As String = Me.Context.Parameters.Item("Args") If Args = "" Then Throw New InstallException("No arguments specified") Else Return Args.Split(","c) End If End Function Private Function GetCorSystemPath() As String Dim Path As New StringBuilder(1024) Dim Size As Integer GetCORSystemDirectory(Path, Path.Capacity, Size) Return Path.ToString End Function Private Function GetSystemPath() As String Return System.Environment.SystemDirectory & "\" End Function Private Sub ProcessStart(ByVal fileName As String, ByVal arguments As String) Dim P As Process Dim Si As New ProcessStartInfo(fileName, arguments) Si.WindowStyle = ProcessWindowStyle.Normal Try P = Process.Start(Si) P.WaitForExit() Catch ex As Exception Throw New InstallException(ex.Message) End Try End Sub End Class Many thanks in advance for any suggestions Jeremy Holt

3 Replies

AD Administrator Syncfusion Team June 6, 2003 10:21 AM UTC

Hi Jeremy, Installing the native image to the GAC is not the same as installing the assembly to the GAC. If you deploy the grid assembly to the same folder as the application, then you do not need to install it the GAC. If you deploy to a separate folder, or have another assembly (in a separate folder) that references the grid assembly, then you should install the grid assembly to the GAC. Let us know if you experience further difficulties with this. Thanks, and have a great day! -Trampas


UN Unknown Syncfusion Team June 6, 2003 04:17 PM UTC

Trampas Thanks your information. In fact I have three major applications which use the suncfusion dlls as well as our own common dlls. All three applications could be running at the same time on one machine. I was under the impression that there was an advantage in installing the common assemblies to GAC - or am I mistaken in this? Regards Jeremy


AD Administrator Syncfusion Team June 8, 2003 11:21 AM UTC

Hi Jeremy, I do not believe that there is a performance advantage, unless you install the native image to the GAC with ngen. The advantage to deployment would be that if you have multiple products linking to the same shared assemblies, these assemblies can be installed into one folder, and then added to the GAC. Making it easier to keep track of installed assemblies that are utilized by your products. -Trampas

Loader.
Live Chat Icon For mobile
Up arrow icon