MSDN > 論壇首頁 > ASMX Web Services and XML Serialization > could not load type "_Default"
發問發問
 

已答覆could not load type "_Default"

  • Tuesday, 11 October, 2005 15:21granville 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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" %>
     


解答

所有回覆

  • Tuesday, 11 October, 2005 18:02MarcD版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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, 11 October, 2005 19:32granville 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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, 16 October, 2005 2:10douglaspMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    this is an asp.net issue.

    You should post it on http://www.asp.net.
  • Thursday, 20 October, 2005 16:44Talespinner 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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, 4 March, 2006 4:51Luis Esteban Valencia MCP Web 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    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, 21 February, 2007 9:32Katil 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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, 17 October, 2007 15:18magnets 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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, 23 October, 2007 17:06RenjithG 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

     

    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, 9 November, 2008 4:16princeTace 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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.