nbruckelmyer
Programmer
I cannot get GAC to work. If you see I did anything wrong, please let me know.
Here is my file
**********hwmod2.vb******************
Imports System
Imports System.Reflection
<assembly:AssemblyVersionAttribute("1.0.0.0">
<assembly:AssemblyKeyFileAttribute("hwmod2.snk">
Namespace HW
Public Class Test
Public Sub Hello(strLang As String)
If strLang = "SP" Then
System.Console.WriteLine("Hola"
Else
System.Console.WriteLine("Hello"
End If
End Sub
End Class
End Namespace
***************************************
I create my key using -
sn -k hwmod2.snk
I then compile the file using -
vbc /out:hwmod2.dll /t:library hwmod2.vb
I then install the file into GAC -
gacutil /i hwmod2.dll
Everything has worked fine till here.
I create my test file in another folder.
********* MyTest.vb************
Imports HW
Namespace MyTest
Public Class Test
Public Sub Test()
hw.Hello("hi"
End Sub
End Class
End Namespace
*****************************
I get this error when I try to compile this file. Any ideas.
vbc MyTest.vb
************* Here is my error msg***********************
Microsoft (R) Visual Basic .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.00.3705
Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.
vbc : error BC30420: 'Sub Main' was not found in 'MyTest'.
C:\GAC\test\MyTest.vb(1) : error BC30466: Namespace or type 'HW' for the Imports
'HW' cannot be found.
Imports HW
~~
C:\GAC\test\MyTest.vb(4) : error BC30001: Statement is not valid in a namespace.
Dim h As New HW()
~~~~~~~~~~~~~~~~~
C:\GAC\test\MyTest.vb(7) : error BC30451: Name 'h' is not declared.
h.Hello("hi"
~
****************************************************
Please help me if you can.
Thanks.
Here is my file
**********hwmod2.vb******************
Imports System
Imports System.Reflection
<assembly:AssemblyVersionAttribute("1.0.0.0">
<assembly:AssemblyKeyFileAttribute("hwmod2.snk">
Namespace HW
Public Class Test
Public Sub Hello(strLang As String)
If strLang = "SP" Then
System.Console.WriteLine("Hola"
Else
System.Console.WriteLine("Hello"
End If
End Sub
End Class
End Namespace
***************************************
I create my key using -
sn -k hwmod2.snk
I then compile the file using -
vbc /out:hwmod2.dll /t:library hwmod2.vb
I then install the file into GAC -
gacutil /i hwmod2.dll
Everything has worked fine till here.
I create my test file in another folder.
********* MyTest.vb************
Imports HW
Namespace MyTest
Public Class Test
Public Sub Test()
hw.Hello("hi"
End Sub
End Class
End Namespace
*****************************
I get this error when I try to compile this file. Any ideas.
vbc MyTest.vb
************* Here is my error msg***********************
Microsoft (R) Visual Basic .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.00.3705
Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.
vbc : error BC30420: 'Sub Main' was not found in 'MyTest'.
C:\GAC\test\MyTest.vb(1) : error BC30466: Namespace or type 'HW' for the Imports
'HW' cannot be found.
Imports HW
~~
C:\GAC\test\MyTest.vb(4) : error BC30001: Statement is not valid in a namespace.
Dim h As New HW()
~~~~~~~~~~~~~~~~~
C:\GAC\test\MyTest.vb(7) : error BC30451: Name 'h' is not declared.
h.Hello("hi"
~
****************************************************
Please help me if you can.
Thanks.