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
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...
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>
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
<div class=sbody>Use one of the following methods to build the application:
•
Use the C# command line compiler (CSC.exe) to run the following command:
<div class=indent>
csc /t:library /r:System.web.dll /out:mydll.dll
myfile.cs</div>
•
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.
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.
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.
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.
aellis
Member
10 Points
2 Posts
Parser Error: Could not load type '_Default'.
Aug 01, 2005 07:51 AM|LINK
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:
Source File: /tracker/Default.aspx Line: 1
Version Information: Microsoft .NET Framework Version:2.0.40607.42; ASP.NET Version:2.0.40607.42
marca
Member
25 Points
5 Posts
Re: Parser Error: Could not load type '_Default'.
Aug 06, 2005 01:22 PM|LINK
Same problem here. Can anybody help us? :-)
/Martin
Mickster
Member
15 Points
3 Posts
Re: Parser Error: Could not load type '_Default'.
Aug 31, 2005 02:27 PM|LINK
Hi All [:)]
I'm also getting the same problem. Any ideas ?
Cheers
Mickster
NateM
Member
5 Points
1 Post
Re: Parser Error: Could not load type '_Default'.
Sep 02, 2005 05:04 PM|LINK
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.
White House
Member
5 Points
1 Post
Re: Parser Error: Could not load type '_Default'.
Oct 07, 2005 03:49 AM|LINK
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:
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
<div class=sbody>Use one of the following methods to build the application:<div class=indent>
csc /t:library /r:System.web.dll /out:mydll.dll myfile.cs</div>
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.
</div>
aaron123
Member
40 Points
8 Posts
Re: Parser Error: Could not load type '_Default'.
Oct 22, 2005 01:48 AM|LINK
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.
Bapha
Member
143 Points
34 Posts
Re: Parser Error: Could not load type '_Default'.
Nov 16, 2005 01:52 PM|LINK
does anyone have any other suggestions?
Thanks
NandaDodd
Member
5 Points
1 Post
Re: Parser Error: Could not load type '_Default'.
Nov 17, 2005 01:33 PM|LINK
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
pato
Member
5 Points
1 Post
Re: Parser Error: Could not load type '_Default'.
Nov 28, 2005 07:49 PM|LINK
you should configure your aplication on IIS
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconconfiguringaspnetapplicationforaspnetversion.asp
Greets
Pato
bashaasnoot
Member
247 Points
65 Posts
Re: Parser Error: Could not load type '_Default'.
Jan 12, 2006 10:14 AM|LINK
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.