Ask a questionAsk a question
 

Answercould not load type "_Default"

  • Tuesday, October 11, 2005 3:21 PMgranville Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi everybody :)

    I'm doing a web app for some university coursework, its the first time I've used ASP.NET C# and I'm loving it but when I put the files on the remote server I get the error on this page.

    http://www.apixelmind.com/email/

    Someone told that I need to copy a project or something and do it that way, I'm using the Visual Studio 2005 Beta 2 version and I can't find this function anywhere.  If anyone could help with that or give me another fix then I would be very grateful.

    Thank you for your time.


    Granville

    p.s. this is my code but this still gives me the same error



    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }

     


    And I am using the default generated statement at the top of each .aspx page.


    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
     


Answers

All Replies

  • Tuesday, October 11, 2005 6:02 PMMarcDModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Your code should be compiled in a DLL file that is called the Assembly. This assembly needs to be deployed with your project - namely it should be put in the bin directory just like it is in on your local host. This allows you to semi-protect your code and makes deploying alot easier.
  • Tuesday, October 11, 2005 7:32 PMgranville Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    how do I do that?? I'me very new to Visual Studion and ASP.NET.

    I have already (in VS 2005) gone to build >> publish htpp://.......

    That created a .dll and some other precompiled files in a bin folder but when I put these on my web server I get the same error still. (url - - http://www.apixelmind.com/bonjovi/)

    Am I going to the wrong function in VS?? if so can someone exaplin the menu and how it is accessed etc please.


    Thank you for your time.


    Granville
  • Sunday, October 16, 2005 2:10 AMdouglaspMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    this is an asp.net issue.

    You should post it on http://www.asp.net.
  • Thursday, October 20, 2005 4:44 PMTalespinner Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have found that I have to go into the offending *.vb file, make a small change (it doesn't matter what), and save the project.  This apparently resets something in the Visual Studio project.  Good luck.
  • Saturday, March 04, 2006 4:51 AMLuis Esteban Valencia MCP Web Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Has somebody solved this?

    I have a solution with 5 class libraries, and they work fine on my pc, I checkin to Visual Source Safe, the other developer download the solution, and when he tries to see a page, He gets that error

     

    Any idea

  • Wednesday, February 21, 2007 9:32 AMKatil Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I heard that when you didn't embed the source codes as script in c# or VB, a dll file  created by .net in source directory(c:\, d:\ ....etc) and same named with your project. So you must either checkin this dll if that isn't like this, you can add your source code as script between head tags.
  • Wednesday, October 17, 2007 3:18 PMmagnets Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I've been forced to do an aspx C# project and it looks like I've got the same problem you've reported.  In a similar version my aspx file with an expanded version of the C# code the same "could not load type "_Default" " does not occur.

    Obviously it is my fault because I did something wrong.  It could not possibly be the fact that the Microsoft product design crew intentionally created so many exceptions to rules so that they could generate maximum revenue by selling even more tools "to make it easier" on developers.  But, I do believe it is a fact that Microsoft designers have an inherent bias against the web because they want to give everything the option of being a Windows-like, if not a Windows, world.

    That being said, it looks like you do have an option, just go write your code in PHP.

    I on the other hand, still need to figure out this context problem where Microsoft could not possibly put themselves out and create either a completely non-Visual Studio or at least create a web context within Visual Studio.  (For example, "Request.QueryString["encryptedData"].ToString()" is out of context since Microsoft decided not to make provisions to simulate the query string as input.)

    Good Luck to you.  I hope you found / find your answer.
  • Tuesday, October 23, 2007 5:06 PMRenjithG Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    Hi,

     

    This is problem with multiple versions of framework installed on the machine.

     

    To rectify this go to IIS manager and right click on Default Web Site and go to properties. In the property window go to ASP.Net tab and There select the ASP.Net Version as 2.0....... instead of 1.1..... Then go to Documents tab and add 'Default.aspx' document if it is not there in the list. and select the virtual directories to which you want to apply this rule for.

     

    Then you should be able to eliminate this error.

     

    Have a nice programing time. Bye

  • Sunday, November 09, 2008 4:16 AMprinceTace Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I simply created a folder with the name "bin" in the IIS virtual directory for my site, and then dropped the dll in said folder.. problem solved, hope this helps.