Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Hi friends i am getting an error while creating the .dll for a component in vb.net....

the error is

Inherits System.ComponentModel.icontainer is not defined...

 

my code is:

 

Imports System
Imports System.Data
Imports System.ComponentModel.Component
Public Class Component1
   Inherits System.ComponentModel.Component
   Public Function func() As String
       func = "func from component1"
   End Function
#Region " Component Designer generated code "

   Public Sub New(ByVal 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

End Class

 

pls give me a idea whats my mistake and let me know how to craete a .dll for component.....

 

 

Thank you

Satya

Edited by divil
Satya
Posted

Hi devil

I remove that line still i am getting the same error....pls tell me can i create a dll for component...whats the diff between class and component in .net.....why its giving an error while creating the dll for component...

 

i am creating the dll like this

 

c:\anand\appl1\appl1>vbc /t:library c:\anand\appl1\appl1\component1.vb

 

 

pls give me idea what to do...

Thank you

Anand

Satya
Posted

Inherits System.ComponentModel.Component

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\anand\appl1\appl1\Component1.vb(15) : error BC30002: Type 'System.ComponentMo

del.IContainer' is not defined.

 

Public Sub New(ByVal Container As System.ComponentModel.IContainer)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\anand\appl1\appl1\Component1.vb(33) : error BC30284: sub 'Dispose' cannot be

declared 'Overrides' because it does not override a sub in a base class.

 

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

~~~~~~~

c:\anand\appl1\appl1\Component1.vb(43) : error BC30002: Type 'System.ComponentMo

del.IContainer' is not defined.

 

Private components As System.ComponentModel.IContainer

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

c:\anand\appl1\appl1\Component1.vb(49) : error BC30002: Type 'System.ComponentMo

del.Container' is not defined.

 

components = New System.ComponentModel.Container()

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

C:\ANAND\APPL1\APPL1>

Satya
Posted

Hi divil

Lot of thanks .....its working fine now...it creates a .dll now for component.....

lot of thanks for ur time

Satya...

Satya
Posted

Hi Divil

I Have a small doubt now..

i created a .dll for a component and i created a strong name for that(comp1.snk) and i add that .snk file to my application ..and i write the line <assembly:assemblykeyfile("comp1.snk")>

i biuld my application..it didnt give any error..............

 

 

but when i am trying to add that .dll into global assembly cache its giving the error

 

C:\ANAND\DLLS>gacutil /i comp1.dll

 

Microsoft ® .NET Global Assembly Cache Utility. Version 1.0.3705.0

Copyright © Microsoft Corporation 1998-2001. All rights reserved.

 

Failure adding assembly to the cache: Attempt to install an assembly without a strong name

 

 

pls give me a idea how to add my dll to GAC...

Thank you

satya

Satya
Posted

hi divil

already i ceated a strong name to my assembly...i want to register that in global assembly cache...pls give me a idea how to do that...

Thank you

Satya

Satya

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...