Could not load type 'psyche.admin.justdoit'.

A

Andy Sutorius

Hi group,

I am getting the "could not load type" error and I'm not sure how to debug.
Obviously it's a namespace error but I don't see it. Below are code
snippets. Yes, the files sit in a subdirectory called "admin". The webpages
in the root directory, "psyche" do not have any errors. So it's something
with the name admin? But what? Yes, all of the webpages in the admin
directory have the same error with their respective webpages in the class
name.

The webpage admin/default.aspx shows this error
Parser Error Message: Could not load type 'psyche.admin.justdoit'.

The code behind (admin/default.aspx.cs) has the following namespace
namespace psyche.admin
{
/// <summary>
/// Summary description for _default.
/// </summary>
public class justdoit : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

Thanks for your help!

Andy
 
A

Andy Sutorius

Ken,

Here is the result from reflector:

public class justdoit : Page
Name:psyche.admin.justdoit
Assembly:psyche, Version=1.0.1868.26508

What would be the next step?

Andy
 
K

Ken Cox [Microsoft MVP]

I take it there's no version/strong name issue and the file is in the /bin
directory?
 
A

Andy Sutorius

You are correct.

In trying to figure this out I created another web project inside of the
same solution. When I created the admin folder and then created a
webform1.aspx and typed in hello the webpage displayed correctly. When I
created webform2.aspx and typed in hello the webpage had a "could not load
type" error similar to the 'psyche.admin.justdoit'. Weird!
 
A

Andy Sutorius

Expanding a bit...I created a new folder (manager) in the new project
(challenge) and created a new webpage (content.aspx)...when I go to view the
page I see
Could not load type 'challenge.manager.content'.

If I build the project (challenge) the error goes away and the page displays
properly.
 
A

Andy Sutorius

Ken,

The error still occurs with psyche.admin.justdoit

I just wanted to see if I could consistenly reproduce the problem with a new
project and I couldn't

I am going to publish the psyche files to my remote server and see if I get
any errors. Thanks for your help.

Andy
 
K

Ken Cox [Microsoft MVP]

Maybe something is messed up in the config file or the project's settings?
Rather than fight it, I'd just move the code into a new project. <grin>
 
A

Andy Sutorius

For the group...a solution...it turns out that the .dll for the project had
become corrupted. I tried deleting the dll and pdb then building the project
again but to no avail I still received the error on select webpages. I
performed a google search on the keywords could not load type and the top
result was a kb article from MS, #306155: PRB: "Could not load type" error
message when you browse to .aspx page by using Visual C# .NET. Although this
wasn't the exact problem I was having, it was certainly related. I was able
to reproduce my problem if I did not build the project every time I added a
new webpage.

Regards,

Andy
 

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,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top