Parser Error: Could not load type '_Default'.

Last post 10-18-2009 10:45 PM by Stormy22. 21 replies.

Sort Posts:

  • Parser Error: Could not load type '_Default'.

    08-01-2005, 3:51 AM
    • Member
      10 point Member
    • aellis
    • Member since 07-14-2005, 9:09 AM
    • Posts 2
    I have been developing an ASP.NET website in C# with Visual C# 2005 express on my laptop. It functions as expected with VWD's debug server and IIS which is set up locally, but when I transfer the files to an IIS site on another computer I get the following error.

    I've done some searching but haven't found the solution, I'd really appreciate any help on this ASAP.

    Regards,
    Alex

    Server Error in '/tracker' Application.

    Parser Error

    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 '_Default'.

    Source Error:

    Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> Line 2: Line 3: <%

    Source File: /tracker/Default.aspx    Line: 1


    Version Information: Microsoft .NET Framework Version:2.0.40607.42; ASP.NET Version:2.0.40607.42
  • Huh? [:^)] Re: Parser Error: Could not load type '_Default'.

    08-06-2005, 9:22 AM
    • Member
      25 point Member
    • marca
    • Member since 08-06-2005, 1:18 PM
    • Posts 5

    Same problem here. Can anybody help us?  :-)

    /Martin

  • Tongue Tied [:S] Re: Parser Error: Could not load type '_Default'.

    08-31-2005, 10:27 AM
    • Member
      15 point Member
    • Mickster
    • Member since 07-06-2005, 10:41 AM
    • Posts 3

    Hi All Smile [:)]

    I'm also getting the same problem. Any ideas ?

    Cheers

    Mickster

  • Re: Parser Error: Could not load type '_Default'.

    09-02-2005, 1:04 PM
    • Member
      5 point Member
    • NateM
    • Member since 09-02-2005, 4:57 PM
    • Posts 1
    I was also hitting this error and just got around it this morning.  However, I'm not sure if my solution will apply to you or not since I see your "Version Information" is already set to at least a higher version of the Framework than I had.  Anyway, here's what I did:

    1) Installed the same version of the Framework as what was on my laptop - my web server actually had the default Framework for 2k3.
    2) Changed the web site configuration to use the new Framework on the asp.net tab.
    3) My publish was failing to copy the code page up to the server - copied the "default.aspx.cs" to the proper folder.
    4) Refreshed the page and voila.

    I hope this helps - I see your version already shows a recent one, but perhaps you upgraded on your laptop but forgot to on the server?  The other gotcha may be the file copy as well...

    Later, Nate.
  • Re: Parser Error: Could not load type '_Default'.

    10-06-2005, 11:49 PM
    • Member
      5 point Member
    • White House
    • Member since 10-07-2005, 3:06 AM
    • Posts 1

    Hi, I got the same problem.

    My app works fine on my local PC, but gets this error when copied to the hosted server.
     

    Server Error in '/' Application.

    Parser Error

    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 'M1Logs.WebForm1'.

    Source Error:

    Line 1:  <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="M1Logs.WebForm1" %>
    Line 2:  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    Line 3:  <HTML>

    Source File: C:\home\aquarius\yyy.net\yyy.net\www\m1logs\webform1.aspx    Line: 1

    Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032


    I read http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306155 PRB: "Could not load type" error message when you browse to .aspx page by using Visual C# .NET and it says:

    CAUSE

    These errors occur if the .aspx page or the Global.asax page contains a reference to a code-behind module and if the application has not been built.

    RESOLUTION

    Use one of the following methods to build the application:

    Use the C# command line compiler (CSC.exe) to run the following command:

    csc /t:library /r:System.web.dll /out:mydll.dll myfile.cs
    In Microsoft Visual Studio .NET, click Build on the Build menu.

    NOTE
    : Microsoft Visual Basic .NET background compiles the project as soon as it is created. Because Visual C# .NET projects only background parse, you must explicitly build the application.



    I checked and my DLL is there in the bin folder.  I copied it to the same folder as .aspx and .aspx.cs files but the problem still persists.

    My app is a simple one built using VS.NET 2003.  I have notepad handcrafted aspx and aspx.cs pages on the same server and they work fine on both my PC and the hosted server.  My handcrafted ones someone does not need the DLL files.

    What have I done wrong?  Or what must I ask the hosting company to do on their server. 

    Thanks.




  • Re: Parser Error: Could not load type '_Default'.

    10-21-2005, 9:48 PM
    • Member
      40 point Member
    • aaron123
    • Member since 11-06-2002, 8:48 AM
    • Posts 8

    It's real easy guys... all you need to do is re-build your application in its new location. This only applies to apps using codebehind. If you use inline code within script blocks the problem will not happen. you can convert codebehind pages by copying the .cs or .vb code into the main aspx page within a script block. Anyway, what you do is copy your files from their local spot to the new server, then in VS click file, open from web, and open your project. Most likely you'll need to conect via FrontPage extentions. Once you connect you can re-build to the server and it will fix the problem.

  • Re: Parser Error: Could not load type '_Default'.

    11-16-2005, 9:52 AM
    • Member
      133 point Member
    • Bapha
    • Member since 07-05-2005, 7:00 AM
    • Posts 34
    I've converted my asp.net page to inline but I am still getting this error (and am still ripping chunks of hair out).

    does anyone have any other suggestions?

    Thanks

  • Re: Parser Error: Could not load type '_Default'.

    11-17-2005, 9:33 AM
    • Member
      5 point Member
    • NandaDodd
    • Member since 11-17-2005, 2:30 PM
    • Posts 1
    I had the same problem this morning, I was able to resolve by re-writing my .dll file bin folder from local to server.

    First time I uploaded only default.aspx and got this error. Later I made default.aspx as start page, built the solution and uploaded deafult.aspx, default.aspx.vb and bin folder (overwrite bin folder) Now it works fine.

    Hope this helps your problems too

  • Re: Parser Error: Could not load type '_Default'.

    11-28-2005, 3:49 PM
    • Member
      5 point Member
    • pato
    • Member since 11-28-2005, 8:45 PM
    • Posts 1
    hello!

    you should configure your aplication on IIS

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconconfiguringaspnetapplicationforaspnetversion.asp

    Greets

    Pato

  • Re: Parser Error: Could not load type '_Default'.

    01-12-2006, 6:14 AM
    • Member
      247 point Member
    • bashaasnoot
    • Member since 06-15-2005, 11:42 AM
    • Posts 65

    I had the same problem:

    I created a new site using VS 2005, configured IIS, tried to browse the homepage of my site where it showed the exact same error message.

    What you have to do is run your website and VS will prompt you that there is web.config, simply select the option where VS creates one for you. Make sure you selected the correct version of the framework in IIS.

    Hope this helps.

  • Re: Parser Error: Could not load type '_Default'.

    01-15-2006, 10:47 AM
    • Member
      5 point Member
    • HuwB
    • Member since 01-15-2006, 3:44 PM
    • Posts 1
    In IIS (with version 2 of the .net framework installed) the last tab is asp.net. Check that your application (site) is configured for the correct version of .net. Mine wasn't after correcting this, this problem was solved
  • Re: Parser Error: Could not load type '_Default'.

    01-15-2006, 4:19 PM
  • Re: Parser Error: Could not load type '_Default'.

    02-23-2006, 11:22 PM
    • Member
      5 point Member
    • Canberra
    • Member since 02-24-2006, 4:15 AM
    • Posts 1
    Select the site on IIS, click ASP.NET tab, select ASP.NET version dropdown box, choosing the version 2 (mine is 2.0.50727).




  • Re: Parser Error: Could not load type '_Default'.

    03-24-2006, 5:38 AM
    • Member
      12 point Member
    • tr1stan
    • Member since 03-24-2006, 10:35 AM
    • Kent
    • Posts 3
    Did you get this problem solved?

    If not - you have to make sure that you build the application after moving it to the new server. (In Visual Studio, right click > build web site)

    Just a thought,

    T
  • Re: Parser Error: Could not load type '_Default'.

    07-28-2006, 3:31 PM
    • Member
      37 point Member
    • jbrune
    • Member since 10-31-2005, 10:34 PM
    • Towson, MD, USA
    • Posts 10
    This happened to me, I realized that I had not copied over my Web.config file over to the application directory on the new server.
Page 1 of 2 (22 items) 1 2 Next >