ASP.NET says "Could not load type 'MyProject.MyWebform'."

  • Thread starter Kevin Parkinson
  • Start date
K

Kevin Parkinson

Hello Eveyone:
I was wondering if someone can set me straight on this little
problem I am having which I believe must be a configuration issue. Everytime
VS.NET creates a new web form and puts this at the top:

Page language="c#" Codebehind="MyWebForm.aspx.cs" AutoEventWireup="false"
Inherits="MyProject.MyWebForm"

....when I hit the page on my server, I get this message:

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 'MyProject.MyWebform'.

Source Error:

Line 1: <%@ Page language="c#" Codebehind="MyWebForm.aspx.cs"
AutoEventWireup="false" Inherits="MyProject.MyWebForm" %>
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
Line 3: <HTML>


It looks like the error is with the 'inherits' directive. Does anyone know a
cure for this? Than you in advance!

Sincerely,
Kevin Parkinson
 
M

Marshal Antony

Hi Kevin,

Make sure your web application on the server has the bin folder with the
dll in it.
If you have MyProject.MyWebform in MyWebForm.aspx.cs,it will work provided
you have
the assembly in the bin directory under the web application folder.

When you hit the page on the server it is looking for the class
in the inherits part, in the assembly in the
bin folder.As it is not found you have the error message.Put the bin folder
with the dll(s) in your web application's
virtual directory.

Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top