Formular una preguntaFormular una pregunta
 

PreguntaCould not load type '_Default'

  • miércoles, 17 de enero de 2007 14:28Chris Via Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    I've looked at countless blogs and forums and have tried everything and I still get the error: Could not load type '_Default'.

    I created an ASP.NET web site, using C# and when I go to the Default.aspx page in the browser I get the error. So far I have removed my lib environment variables from Windows System panel, checked with the VS2005 Cmd Prompt to make sure it's set correctly there, I build the web site, I have my Web.config file telling it debug=true, and so on. No matter what I do, after it builds and I copy the files to the web server and navigate to the page, I get the Could not load type '_Default' error.

    The only way I've been able to get around this is to use Inline Coding and I desperately want to get away from that!!!

    Any help is greatly appreciated.

    - Chris

Todas las respuestas

  • miércoles, 17 de enero de 2007 18:25TaylorMichaelLMVP, ModeradorMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    The LIB stuff is only for C++. 

    It sounds like you are not copying all the necessary files to your web server.  Under the default v2 model for a web site you will copy all the files including the cs files to the web server.  The cs files will get compiled on the fly as needed by ASP.NET.  You can change the default settings through the project settings.  If you pre-compile your site then you'll need to be sure to copy the Bin\ directory and its files to the web server.

    Michael Taylor - 1/17/07
    http://p3net.mvps.org

     

  • miércoles, 17 de enero de 2007 18:37Chris Via Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Thanks for your reply. I think I've got it working now. I had to use the following asp compiler command:

    aspnet_compiler -p "D:\BuildManagerApp" -f -v -u "D:\Inetpub\wwwroot\BuildManager"

    Then, it works. I don't have to move any files (including bin) or any of that. It seems to compile a DLL and then marker files for my code and place that in the IIS directory.

  • domingo, 21 de enero de 2007 22:48frederikm Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Hi

    just a quick question,

    did you create your virtual directory by hand in iis or did you create it from within visual studio?

    I had a similar problem where the error i got was that asp.net could not find/create the global.asax type

    removing the virtual directory from iis and recreating if from within visual studio solved the issue

     

    Kind regards

     

  • martes, 15 de julio de 2008 8:06YouCanDoIt Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    In the setup project you create for your application, you must specify that the Primary output from the Project goes into the "bin" folder (click on the "primary output" and browse to "bin" in the Folder property) , otherwise IIS can't find it. Once the dll is in the bin folder, IIS finds it and loads it.