P
Phil Certain
Hi,
Relative newbie to .Net but experienced with classic ASP. I am trying
to create a simple business object to contain commonly used functions.
This is what I have done:
1 - Created a simple vb file containing:
Imports System.Data.SqlClient
Imports System.Web.HttpUtility
Namespace MyComponents
Public Class HandleErrors
Public Function HandleSqlError(ByVal objException As
SqlException)
' Simple error handling function
End Function
End Class
End Namespace
2 - Compiled the 'class' using the command line:
vbc /t:library /r:system.web.dll /r:system.data.dll mylib.vb
It compiles without errors.
3 - Moved the resulting dll (mylib.dll) into the /bin directory of my
web app.
4 - Created /bin as an application in IIS5
5 - Added Everyone/Full permissions (temporarily) to the dll to ensure
that there are no problems due to permissions.
When trying to run the application through a browser I get the error
message:
Compiler Error Message: BC30466: Namespace or type 'myComponents' for
the Imports 'myComponents' cannot be found.
Source Error:
Line 14: Imports Microsoft.VisualBasic
Line 15:
Line 16: Imports myComponents
Line 17:
Line 18:
SUbsequently I've added the following to web.config, but to no avail:
<compilation debug="true" >
<assemblies>
<!--Tell ASP.NET to load all assemblies from /bin -->
<add assembly="*"/>
</assemblies>
</compilation>
At this point I'm not even calling or referring to the function
contained in the myLib.dll, but the error persists. I've also
replicated the problem using a 'business object' tutorial to try and
eliminate my code from the equation, so I am thinking that this is
conguration or process related rather than code related.
I've found many similar problems reported in the Newsgroups but no
real definative answers.
So any help or pointers would be appreciated before I go completely
bald! What am I not doing or what am I doing wrong? Does anyone have
the missing page of the manual?
(Running .Net 1.1 with SP1, Windows2000 Server SP4, all patches up to
date.)
Relative newbie to .Net but experienced with classic ASP. I am trying
to create a simple business object to contain commonly used functions.
This is what I have done:
1 - Created a simple vb file containing:
Imports System.Data.SqlClient
Imports System.Web.HttpUtility
Namespace MyComponents
Public Class HandleErrors
Public Function HandleSqlError(ByVal objException As
SqlException)
' Simple error handling function
End Function
End Class
End Namespace
2 - Compiled the 'class' using the command line:
vbc /t:library /r:system.web.dll /r:system.data.dll mylib.vb
It compiles without errors.
3 - Moved the resulting dll (mylib.dll) into the /bin directory of my
web app.
4 - Created /bin as an application in IIS5
5 - Added Everyone/Full permissions (temporarily) to the dll to ensure
that there are no problems due to permissions.
When trying to run the application through a browser I get the error
message:
Compiler Error Message: BC30466: Namespace or type 'myComponents' for
the Imports 'myComponents' cannot be found.
Source Error:
Line 14: Imports Microsoft.VisualBasic
Line 15:
Line 16: Imports myComponents
Line 17:
Line 18:
SUbsequently I've added the following to web.config, but to no avail:
<compilation debug="true" >
<assemblies>
<!--Tell ASP.NET to load all assemblies from /bin -->
<add assembly="*"/>
</assemblies>
</compilation>
At this point I'm not even calling or referring to the function
contained in the myLib.dll, but the error persists. I've also
replicated the problem using a 'business object' tutorial to try and
eliminate my code from the equation, so I am thinking that this is
conguration or process related rather than code related.
I've found many similar problems reported in the Newsgroups but no
real definative answers.
So any help or pointers would be appreciated before I go completely
bald! What am I not doing or what am I doing wrong? Does anyone have
the missing page of the manual?
(Running .Net 1.1 with SP1, Windows2000 Server SP4, all patches up to
date.)