Hi Kunal
How are u doing??i have a small problem..pls help me..bcz almost i wasted a oneday time for this...still i am getting an error ..
pls give me a idea what apeps i have to follow to register my dll in GAC.....
i am getting the error
failure to attemp;attempt to register a assembly without string name
but i craeetd a strong name to my assembly...still its giving the above error...
pls give me a idea what steps i have to follow to register my dll in GAC...
assume that my application path is
c:\anand\appl1\appl3
pls let me know whats my mistake..i am doing like this
i craeted a component(componnet1.vb) and the code in that component is
Public Class Component1
Inherits System.ComponentModel.Component
#Region " Component Designer generated code "
Public Sub New(Container As System.ComponentModel.IContainer)
MyClass.New()
'Required for Windows.Forms Class Composition Designer support
Container.Add(me)
End Sub
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Component 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.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
#End Region
Public Function func1() As String
func1 = "this is func"
End Function
End Class
and the code in form is(form.vb)
Imports System.Runtime.InteropServices
Imports System.Data
Imports System.Data.OleDb
Imports System
Imports System.Reflection
'<Assembly: AssemblyKeyFileAttribute("c:\anand\appl1\appl3\comp1.snk")>
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form 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 Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim obj1 As New Component1()
MessageBox.Show(obj1.func1)
End Sub
End Class
after that i created a component1.dll file
c:\anand\appl1\appl3>vbc component1.vb /t:library /r:system.dll /r:system.data.dll
now i have a dll component1.dll and i created a strong name to that
c:\anand\appl1\appl3>sn -k comp1.snk
and i add that comp1.snk to my application and i write the line of code <assembly: assemblykeyfile("comp1.snk")>
and built the application again
now i am doing like this
c:\anand\appl1\appl3>gacutil/i component1.dll
now i am getting the error
failure to attempt;attempt to add an assembly without strong name...
pls let me know my mistake and let me know what steps i have to follow ....
Lot of thanks
Anand
How are u doing??i have a small problem..pls help me..bcz almost i wasted a oneday time for this...still i am getting an error ..
pls give me a idea what apeps i have to follow to register my dll in GAC.....
i am getting the error
failure to attemp;attempt to register a assembly without string name
but i craeetd a strong name to my assembly...still its giving the above error...
pls give me a idea what steps i have to follow to register my dll in GAC...
assume that my application path is
c:\anand\appl1\appl3
pls let me know whats my mistake..i am doing like this
i craeted a component(componnet1.vb) and the code in that component is
Public Class Component1
Inherits System.ComponentModel.Component
#Region " Component Designer generated code "
Public Sub New(Container As System.ComponentModel.IContainer)
MyClass.New()
'Required for Windows.Forms Class Composition Designer support
Container.Add(me)
End Sub
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Component 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.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
#End Region
Public Function func1() As String
func1 = "this is func"
End Function
End Class
and the code in form is(form.vb)
Imports System.Runtime.InteropServices
Imports System.Data
Imports System.Data.OleDb
Imports System
Imports System.Reflection
'<Assembly: AssemblyKeyFileAttribute("c:\anand\appl1\appl3\comp1.snk")>
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form 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 Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim obj1 As New Component1()
MessageBox.Show(obj1.func1)
End Sub
End Class
after that i created a component1.dll file
c:\anand\appl1\appl3>vbc component1.vb /t:library /r:system.dll /r:system.data.dll
now i have a dll component1.dll and i created a strong name to that
c:\anand\appl1\appl3>sn -k comp1.snk
and i add that comp1.snk to my application and i write the line of code <assembly: assemblykeyfile("comp1.snk")>
and built the application again
now i am doing like this
c:\anand\appl1\appl3>gacutil/i component1.dll
now i am getting the error
failure to attempt;attempt to add an assembly without strong name...
pls let me know my mistake and let me know what steps i have to follow ....
Lot of thanks
Anand