ASP.NET web app to use DLL (How to?)

  • Thread starter Green Start Button
  • Start date
G

Green Start Button

Hello, Folks!

I am developing an interface for a web site to view knowledge base articles. So far, I have the web app working, however, my employer now wants it to work like the rest of their web site apps by using the CodeBehind / DLL method. However, I only have WebMatrix and the dotNET Framework v1.1 on an IIS 6.0 server.

The interface works by itself and I have figured out how to complile a DLL, however, I cannot get the web app to use the compiled DLL.

Here is the command line I use to compile the DLL:
vbc /t:library /rootnamespace:KBase /imports:Microsoft.VisualBasic /r:System.dll,System.Drawing.dll,System.Design.dll,System.Web.Services.dll,System.data.dll,System.Web.dll,System.xml.dll,System.DirectoryServices.dll /out:.\bin\KBase.dll KBaseViewer.vb ViewArticle.vb AssemblyInfo.vb > error.txt

The first page is for searching to locate the right article:
<%@ Page Language="vb" autoeventwireup="false" CodeBehind="KBaseViewer.vb" Inherits="KBaseViewer" %>
<html>
....
</html>

The next page displays the contents of the article:
<%@ Page Language="vb" autoeventwireup="false" CodeBehind="ViewArticle.vb" Inherits="ViewArticle" %>
<html>
....
</html>

When I load the KBaseViewer.aspx page I get:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'KBaseViewer'.

Source Error: ...blah...blah...blah...


When I use 'src=...' it works fine but does not appear to be using the DLL file.

What am I missing / doing wrong?

TIA...
 
K

Kevin Spencer

If your employer wants it that way, I would suggest telling your employer to
spring for Visual Studio.Net, which is built for this type of development.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.

Hello, Folks!

I am developing an interface for a web site to view knowledge base
articles. So far, I have the web app working, however, my employer now
wants it to work like the rest of their web site apps by using the
CodeBehind / DLL method. However, I only have WebMatrix and the dotNET
Framework v1.1 on an IIS 6.0 server.

The interface works by itself and I have figured out how to complile a
DLL, however, I cannot get the web app to use the compiled DLL.

Here is the command line I use to compile the DLL:
vbc /t:library /rootnamespace:KBase /imports:Microsoft.VisualBasic
/r:System.dll,System.Drawing.dll,System.Design.dll,System.Web.Services.dll,System.data.dll,System.Web.dll,System.xml.dll,System.DirectoryServices.dll
/out:.\bin\KBase.dll KBaseViewer.vb ViewArticle.vb AssemblyInfo.vb >
error.txt

The first page is for searching to locate the right article:
<%@ Page Language="vb" autoeventwireup="false" CodeBehind="KBaseViewer.vb"
Inherits="KBaseViewer" %>
<html>
....
</html>

The next page displays the contents of the article:
<%@ Page Language="vb" autoeventwireup="false" CodeBehind="ViewArticle.vb"
Inherits="ViewArticle" %>
<html>
....
</html>

When I load the KBaseViewer.aspx page I get:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: Could not load type 'KBaseViewer'.

Source Error: ...blah...blah...blah...


When I use 'src=...' it works fine but does not appear to be using the DLL
file.

What am I missing / doing wrong?

TIA...
 
B

Bruce Barker

when you use a code behind dll, you need to specify the namespace. try:

<%@ Page Language="vb" autoeventwireup="false" CodeBehind="KBaseViewer.vb" Inherits="KBase.KBaseViewer" %>

-- bruce (sqlwork.com)


Hello, Folks!

I am developing an interface for a web site to view knowledge base articles. So far, I have the web app working, however, my employer now wants it to work like the rest of their web site apps by using the CodeBehind / DLL method. However, I only have WebMatrix and the dotNET Framework v1.1 on an IIS 6.0 server.

The interface works by itself and I have figured out how to complile a DLL, however, I cannot get the web app to use the compiled DLL.

Here is the command line I use to compile the DLL:
vbc /t:library /rootnamespace:KBase /imports:Microsoft.VisualBasic /r:System.dll,System.Drawing.dll,System.Design.dll,System.Web.Services.dll,System.data.dll,System.Web.dll,System.xml.dll,System.DirectoryServices.dll /out:.\bin\KBase.dll KBaseViewer.vb ViewArticle.vb AssemblyInfo.vb > error.txt

The first page is for searching to locate the right article:
<%@ Page Language="vb" autoeventwireup="false" CodeBehind="KBaseViewer.vb" Inherits="KBaseViewer" %>
<html>
...
</html>

The next page displays the contents of the article:
<%@ Page Language="vb" autoeventwireup="false" CodeBehind="ViewArticle.vb" Inherits="ViewArticle" %>
<html>
...
</html>

When I load the KBaseViewer.aspx page I get:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'KBaseViewer'.

Source Error: ...blah...blah...blah...


When I use 'src=...' it works fine but does not appear to be using the DLL file.

What am I missing / doing wrong?

TIA...
 
G

Green Start Button

Thank you, Mr. Barker!

That and placing the DLL into the wwwroot\bin folder did the trick.
when you use a code behind dll, you need to specify the namespace. try:

<%@ Page Language="vb" autoeventwireup="false" CodeBehind="KBaseViewer.vb" Inherits="KBase.KBaseViewer" %>

-- bruce (sqlwork.com)


Hello, Folks!

I am developing an interface for a web site to view knowledge base articles. So far, I have the web app working, however, my employer now wants it to work like the rest of their web site apps by using the CodeBehind / DLL method. However, I only have WebMatrix and the dotNET Framework v1.1 on an IIS 6.0 server.

The interface works by itself and I have figured out how to complile a DLL, however, I cannot get the web app to use the compiled DLL.

Here is the command line I use to compile the DLL:
vbc /t:library /rootnamespace:KBase /imports:Microsoft.VisualBasic /r:System.dll,System.Drawing.dll,System.Design.dll,System.Web.Services.dll,System.data.dll,System.Web.dll,System.xml.dll,System.DirectoryServices.dll /out:.\bin\KBase.dll KBaseViewer.vb ViewArticle.vb AssemblyInfo.vb > error.txt

The first page is for searching to locate the right article:
<%@ Page Language="vb" autoeventwireup="false" CodeBehind="KBaseViewer.vb" Inherits="KBaseViewer" %>
<html>
...
</html>

The next page displays the contents of the article:
<%@ Page Language="vb" autoeventwireup="false" CodeBehind="ViewArticle.vb" Inherits="ViewArticle" %>
<html>
...
</html>

When I load the KBaseViewer.aspx page I get:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'KBaseViewer'.

Source Error: ...blah...blah...blah...


When I use 'src=...' it works fine but does not appear to be using the DLL file.

What am I missing / doing wrong?

TIA...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top