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

  • Thread starter Thread starter Kevin Parkinson
  • Start date 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
 
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
 
Back
Top