473,322 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Could not load type error with Asp.Net 2.0

I built an ASP site using the new Visual Studio 2005. The site uses a
simple master page. On my local machine everything runs just fine.
When I publish the site and FTP it to the server, it doesn't run. I
get the following error message.

Server Error in '/test2' 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 'MasterPage'.

Source Error:
Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="MasterPage" %>
Line 2:
Line 3: <html>
Source File: /test2/MasterPage.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42

Anybody know what's going on? I am getting pretty frustrated. I have
no idea what is wrong, and nobody on the web seems to know either. And
yes, .net 2.0 is installed, as indicated in the error message.

Dec 1 '05 #1
10 11955
Ram
The name you have chosen conflicts with the name of MasterPage control, try
renaming your MasterPage.Master to something else like PageTemplate or
something like that.
--
Thanks,
<Ram/>
"we**********@gmail.com" wrote:
I built an ASP site using the new Visual Studio 2005. The site uses a
simple master page. On my local machine everything runs just fine.
When I publish the site and FTP it to the server, it doesn't run. I
get the following error message.

Server Error in '/test2' 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 'MasterPage'.

Source Error:
Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="MasterPage" %>
Line 2:
Line 3: <html>
Source File: /test2/MasterPage.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42

Anybody know what's going on? I am getting pretty frustrated. I have
no idea what is wrong, and nobody on the web seems to know either. And
yes, .net 2.0 is installed, as indicated in the error message.

Dec 1 '05 #2
I build a whole new project and tried naming the masterfile
"Interface.master" instead. Same problem, here is the new error
message. I also noticed that when I created the master page file, the
default name that VS2005 tried to use was "MasterPage.master" If there
was something wrong with that filename, why would they plug it in there
for you at first?

Any other suggestions?

Server Error in '/test2' 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 'Interface'.

Source Error:
Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="Interface" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Source File: /test2/Interface.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42

Dec 1 '05 #3
You can use "MasterPage.master". That name isn't a problem.

Are you, at least, building the master page or rebuilding
the application after you create your new .master file ?

Where are you placing "MasterPage.master.cs" ?
( and/or "Interface.master.cs", in this case... )

Juan T. Llibre
ASP.NET.FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

<we**********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I build a whole new project and tried naming the masterfile
"Interface.master" instead. Same problem, here is the new error
message. I also noticed that when I created the master page file, the
default name that VS2005 tried to use was "MasterPage.master" If there
was something wrong with that filename, why would they plug it in there
for you at first?

Any other suggestions?

Server Error in '/test2' 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 'Interface'.

Source Error:
Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="Interface" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Source File: /test2/Interface.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42

Dec 1 '05 #4
On 30 Nov 2005 19:17:37 -0800, we**********@gmail.com wrote:


Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="MasterPage" %>
Line 2:
Line 3: <html>


If you are using the inherits attribute, you probably have a CodeFile
with the class MasterPage that you inherit from. What happened to the
CodeFile attribute?

--
Scott
http://www.OdeToCode.com/blogs/scott/
Dec 1 '05 #5
And that page directive should read :

<%@ Master Language="C#" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>


Juan T. Llibre
ASP.NET.FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:jl********************************@4ax.com...
On 30 Nov 2005 19:17:37 -0800, we**********@gmail.com wrote:

Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="MasterPage" %>
Line 2:
Line 3: <html>
If you are using the inherits attribute, you probably have a CodeFile
with the class MasterPage that you inherit from. What happened to the
CodeFile attribute?

Dec 1 '05 #6
I am not doing anything fancy. All I'm doing is using the wizard
inside VS2005. I am very very familiar with ASP 1.1 and classic ASP,
but this is my first experiment with 2.0. I am not editing the code or
doing anything manually. I'm just trying to build it and get it on the
server.

This is what I do:

1) Create new web site project.
2) Delete "default.aspx"
3) Create a master page.
4) Add "default.aspx" and assign it to the master page.
5) Build the site by selecting Build/Build Web Site - it returns no
errors.
6) Publish the site with Build/Publish - I publish it to my local
machine, so the files end up in PrecompiledWeb\mytestsite
7) FTP the entire file structure to the web server.

And that's it. When I go to the site, I get that error message. Any
questions?

Dec 1 '05 #7
The Page directive should be :

<%@ Master Language="C#" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

The error you posted was :
Line 1: <%@ master language="C#" autoeventwireup="true" inherits="MasterPage" %>
Notice that you did *not* have the "CodeFile" attribute set.
Did you fix that ?

Juan T. Llibre
ASP.NET.FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

<we**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...I am not doing anything fancy. All I'm doing is using the wizard
inside VS2005. I am very very familiar with ASP 1.1 and classic ASP,
but this is my first experiment with 2.0. I am not editing the code or
doing anything manually. I'm just trying to build it and get it on the
server.

This is what I do:

1) Create new web site project.
2) Delete "default.aspx"
3) Create a master page.
4) Add "default.aspx" and assign it to the master page.
5) Build the site by selecting Build/Build Web Site - it returns no
errors.
6) Publish the site with Build/Publish - I publish it to my local
machine, so the files end up in PrecompiledWeb\mytestsite
7) FTP the entire file structure to the web server.

And that's it. When I go to the site, I get that error message. Any
questions?

Dec 1 '05 #8
It's hard to have a .cs file when you are working with a precompiled
site. The CS is not supposed to exist, that's the whole point of
asp.net. That directive DOES exist when you go look at the code. But
I'm having problems with the compiled site on distribution.

Dec 1 '05 #9
re:
It's hard to have a .cs file when you are working with a precompiled
site.
I didn't ask you to upload the .cs file.

However, the correct page directive must exist, so that the compiler
knows where the code-behind file for your master page file is located.

If the compiler can't find the code-behind file for your master page,
the result is *exactly* the error you've posted.

re:That directive DOES exist when you go look at the code.
Bear with me and answer my question.

The error you posted was :
Line 1: <%@ master language="C#" autoeventwireup="true" inherits="MasterPage" %>
Notice that you did *not* have the "CodeFile" attribute set.

Your "MasterPage.master" file should have the page directive :

<%@ Master Language="C#" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

Did you fix that ?


Juan T. Llibre
ASP.NET.FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

<we**********@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com... It's hard to have a .cs file when you are working with a precompiled
site. The CS is not supposed to exist, that's the whole point of
asp.net. That directive DOES exist when you go look at the code. But
I'm having problems with the compiled site on distribution.

Dec 1 '05 #10
%u
This seems to be a common problem accross all versions from what I have found on
the web. In my case, as long as the folder name that you built the application
in and folder name that you upload it to are the same, it should work. The local
folder name is the same as the project name and is created by VS. To check this
out, change the name of your local folder and you should get the same error.
Please reply if you have figured out how to resolve the problem in a better way.
Dec 7 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Rene | last post by:
Hi, I'm spend many hour to fix this problem, read many articles about it but no article gave a solution. To isolate the problem I've created in IIS6 (WServer2003) a virtual directory test to...
6
by: Marvin Libson | last post by:
Hi All: I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I have created a java UDF and trigger. When I update my database I get the following error: SQL1224N A database...
4
by: Bogosian | last post by:
I am working on an asp.net project.There is a subdir called OSearch,with a few aspx pages in it which as all other pages on the website use some controls.These controls are stored in a another...
9
by: Andy Sutorius | last post by:
Hi group, I am getting the "could not load type" error and I'm not sure how to debug. Obviously it's a namespace error but I don't see it. Below are code snippets. Yes, the files sit in a...
1
by: JD | last post by:
Hello Everyone, I am working on a asp.net application and I have encountered an error that is confusing the heck out of me, this is the structure of the website /root /root/admin If I hit...
1
by: Chriss | last post by:
I receive "could not load type" error message when trying to load aspx page. The DLL is built and is located in the correct bin directory. The type name in the "inherits" attribute matches the...
1
by: z f | last post by:
hi, I have a vb.net asp.net web app. suddenly after working for long time, I get this error message in my app: Could not load type when trying to show a web form. what can be the error? the...
0
by: qiang | last post by:
Hi everyone, Could you please take a look at an exception for ASP.NET application? My ASP.NET application is using Infragistics WebChart control. I encounter an exception below when...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
3
by: =?Utf-8?B?SGVyYg==?= | last post by:
I've developed an ASP.NET website that runs fine on my local WinXP IIS and on my server's IIS, both are IIS6.0 The site uses a master page that has the following declaration: <%@ Master...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.