By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,626 Members | 2,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,626 IT Pros & Developers. It's quick & easy.

Parser Error - Could not load type

P: n/a
Hi peeps

Ok, I've got a web application running (lets call it MyApp, so its namespace
is MyApp). I've created a subdirectory within this application called
"secure", and made than an Application in IIS too. Plus I've added another
web.config in there.

Then I added an aspx page (called UpdateLogin.aspx), which created itself in
the namespace "MyApp.secure", but when I try to load this page im getting...

"Parser Error Message: Could not load type 'MyApp.secure.UpdateLogin'."

Here's the line it's failing on...

<%@ Page language="c#" Codebehind="UpdateLogin.aspx.cs"
AutoEventWireup="false" Inherits="MyApp.secure.UpdateLogin" %>

All files are there, have tried taking out ".secure" from the namespace and
the reference, have tried adding the directory to the Codebehind option, but
all to no avail.

What's going on?

Cheers
Dan
Nov 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hey Dan:

You probably do not want the secure subdirectory to be an application.
..NET will assume it has it's own bin directory and is looking for a
dll in secure\bin to find the code for the aspx file.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 07:45:07 -0800, dhnriverside <da*@musoswire.com>
wrote:
Hi peeps

Ok, I've got a web application running (lets call it MyApp, so its namespace
is MyApp). I've created a subdirectory within this application called
"secure", and made than an Application in IIS too. Plus I've added another
web.config in there.

Then I added an aspx page (called UpdateLogin.aspx), which created itself in
the namespace "MyApp.secure", but when I try to load this page im getting...

"Parser Error Message: Could not load type 'MyApp.secure.UpdateLogin'."

Here's the line it's failing on...

<%@ Page language="c#" Codebehind="UpdateLogin.aspx.cs"
AutoEventWireup="false" Inherits="MyApp.secure.UpdateLogin" %>

All files are there, have tried taking out ".secure" from the namespace and
the reference, have tried adding the directory to the Codebehind option, but
all to no avail.

What's going on?

Cheers
Dan


Nov 19 '05 #2

P: n/a
Ok, thats cool. But the web.config file (code below) said it needed to be an
application, hence. This web.config overwrites parts of the web.config in the
main app directory.

I can I get round it wanting to be an application?

Cheers
Dan

\secure\web.config...

<configuration>
<system.web>
<authentication mode="Forms">
<forms
name="ADupdateAuth"
path="/"
loginUrl="UpdateLogin.aspx"
protection="All"
timeout="30"
/>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>


"Scott Allen" wrote:
Hey Dan:

You probably do not want the secure subdirectory to be an application.
..NET will assume it has it's own bin directory and is looking for a
dll in secure\bin to find the code for the aspx file.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 07:45:07 -0800, dhnriverside <da*@musoswire.com>
wrote:
Hi peeps

Ok, I've got a web application running (lets call it MyApp, so its namespace
is MyApp). I've created a subdirectory within this application called
"secure", and made than an Application in IIS too. Plus I've added another
web.config in there.

Then I added an aspx page (called UpdateLogin.aspx), which created itself in
the namespace "MyApp.secure", but when I try to load this page im getting...

"Parser Error Message: Could not load type 'MyApp.secure.UpdateLogin'."

Here's the line it's failing on...

<%@ Page language="c#" Codebehind="UpdateLogin.aspx.cs"
AutoEventWireup="false" Inherits="MyApp.secure.UpdateLogin" %>

All files are there, have tried taking out ".secure" from the namespace and
the reference, have tried adding the directory to the Codebehind option, but
all to no avail.

What's going on?

Cheers
Dan


Nov 19 '05 #3

P: n/a
Does the main web site use a different authentication mechanism, like
Windows authentication?

If not, you can specify the specific sub directories to protect using
the inside a <location> element.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 08:47:05 -0800, dhnriverside <da*@musoswire.com>
wrote:
Ok, thats cool. But the web.config file (code below) said it needed to be an
application, hence. This web.config overwrites parts of the web.config in the
main app directory.

I can I get round it wanting to be an application?

Cheers
Dan

\secure\web.config...

<configuration>
<system.web>
<authentication mode="Forms">
<forms
name="ADupdateAuth"
path="/"
loginUrl="UpdateLogin.aspx"
protection="All"
timeout="30"
/>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>


"Scott Allen" wrote:
Hey Dan:

You probably do not want the secure subdirectory to be an application.
..NET will assume it has it's own bin directory and is looking for a
dll in secure\bin to find the code for the aspx file.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 07:45:07 -0800, dhnriverside <da*@musoswire.com>
wrote:
>Hi peeps
>
>Ok, I've got a web application running (lets call it MyApp, so its namespace
>is MyApp). I've created a subdirectory within this application called
>"secure", and made than an Application in IIS too. Plus I've added another
>web.config in there.
>
>Then I added an aspx page (called UpdateLogin.aspx), which created itself in
>the namespace "MyApp.secure", but when I try to load this page im getting...
>
>"Parser Error Message: Could not load type 'MyApp.secure.UpdateLogin'."
>
>Here's the line it's failing on...
>
><%@ Page language="c#" Codebehind="UpdateLogin.aspx.cs"
>AutoEventWireup="false" Inherits="MyApp.secure.UpdateLogin" %>
>
>All files are there, have tried taking out ".secure" from the namespace and
>the reference, have tried adding the directory to the Codebehind option, but
>all to no avail.
>
>What's going on?
>
>Cheers
>
>
>Dan



Nov 19 '05 #4

P: n/a
Yes it does. The main system using Windows Authentication. I'm try to create
a system to allow the user to update his/her Active Directory info (address,
tel, etc), but obviously I want them to login proper for that (security!).
Hence the directory, web app and web.config file.

Is there any way to make it work though? :)

"Scott Allen" wrote:
Does the main web site use a different authentication mechanism, like
Windows authentication?

If not, you can specify the specific sub directories to protect using
the inside a <location> element.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 08:47:05 -0800, dhnriverside <da*@musoswire.com>
wrote:
Ok, thats cool. But the web.config file (code below) said it needed to be an
application, hence. This web.config overwrites parts of the web.config in the
main app directory.

I can I get round it wanting to be an application?

Cheers
Dan

\secure\web.config...

<configuration>
<system.web>
<authentication mode="Forms">
<forms
name="ADupdateAuth"
path="/"
loginUrl="UpdateLogin.aspx"
protection="All"
timeout="30"
/>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>


"Scott Allen" wrote:
Hey Dan:

You probably do not want the secure subdirectory to be an application.
..NET will assume it has it's own bin directory and is looking for a
dll in secure\bin to find the code for the aspx file.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 07:45:07 -0800, dhnriverside <da*@musoswire.com>
wrote:

>Hi peeps
>
>Ok, I've got a web application running (lets call it MyApp, so its namespace
>is MyApp). I've created a subdirectory within this application called
>"secure", and made than an Application in IIS too. Plus I've added another
>web.config in there.
>
>Then I added an aspx page (called UpdateLogin.aspx), which created itself in
>the namespace "MyApp.secure", but when I try to load this page im getting...
>
>"Parser Error Message: Could not load type 'MyApp.secure.UpdateLogin'."
>
>Here's the line it's failing on...
>
><%@ Page language="c#" Codebehind="UpdateLogin.aspx.cs"
>AutoEventWireup="false" Inherits="MyApp.secure.UpdateLogin" %>
>
>All files are there, have tried taking out ".secure" from the namespace and
>the reference, have tried adding the directory to the Codebehind option, but
>all to no avail.
>
>What's going on?
>
>Cheers
>
>
>Dan


Nov 19 '05 #5

P: n/a
Well, you could just force them to login with thier windows account
using windows authentication. In that case you wouldn't need an
<authentication> element in the sub directory, but just an
<authorization> element to keep out anonymous users and only allow in
authenticated users. Know what I mean?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 10:33:01 -0800, dhnriverside <da*@musoswire.com>
wrote:
Yes it does. The main system using Windows Authentication. I'm try to create
a system to allow the user to update his/her Active Directory info (address,
tel, etc), but obviously I want them to login proper for that (security!).
Hence the directory, web app and web.config file.

Is there any way to make it work though? :)

"Scott Allen" wrote:
Does the main web site use a different authentication mechanism, like
Windows authentication?

If not, you can specify the specific sub directories to protect using
the inside a <location> element.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 08:47:05 -0800, dhnriverside <da*@musoswire.com>
wrote:
>Ok, thats cool. But the web.config file (code below) said it needed to be an
>application, hence. This web.config overwrites parts of the web.config in the
>main app directory.
>
>I can I get round it wanting to be an application?
>
>Cheers
>
>
>Dan
>
>\secure\web.config...
>
><configuration>
> <system.web>
> <authentication mode="Forms">
> <forms
> name="ADupdateAuth"
> path="/"
> loginUrl="UpdateLogin.aspx"
> protection="All"
> timeout="30"
> />
> </authentication>
> <authorization>
> <deny users="?" />
> </authorization>
> </system.web>
></configuration>
>
>
>
>
>"Scott Allen" wrote:
>
>> Hey Dan:
>>
>> You probably do not want the secure subdirectory to be an application.
>> ..NET will assume it has it's own bin directory and is looking for a
>> dll in secure\bin to find the code for the aspx file.
>>
>> --
>> Scott
>> http://www.OdeToCode.com/blogs/scott/
>>
>> On Wed, 2 Feb 2005 07:45:07 -0800, dhnriverside <da*@musoswire.com>
>> wrote:
>>
>> >Hi peeps
>> >
>> >Ok, I've got a web application running (lets call it MyApp, so its namespace
>> >is MyApp). I've created a subdirectory within this application called
>> >"secure", and made than an Application in IIS too. Plus I've added another
>> >web.config in there.
>> >
>> >Then I added an aspx page (called UpdateLogin.aspx), which created itself in
>> >the namespace "MyApp.secure", but when I try to load this page im getting...
>> >
>> >"Parser Error Message: Could not load type 'MyApp.secure.UpdateLogin'."
>> >
>> >Here's the line it's failing on...
>> >
>> ><%@ Page language="c#" Codebehind="UpdateLogin.aspx.cs"
>> >AutoEventWireup="false" Inherits="MyApp.secure.UpdateLogin" %>
>> >
>> >All files are there, have tried taking out ".secure" from the namespace and
>> >the reference, have tried adding the directory to the Codebehind option, but
>> >all to no avail.
>> >
>> >What's going on?
>> >
>> >Cheers
>> >
>> >
>> >Dan
>>
>>



Nov 19 '05 #6

P: n/a
Hmm... they've just logged into Windows and the Intranet app comes up, so we
wnted to avoid having to enter their password again.

So I've got the main app set to Deny unknown users, and use IWA/Windows
Auth. That means they don't have to login for the main app.

That's not really the problem is it. The problem is I cannot create an aspx
within that directory. I put one in there that I created and then moved into
the dir, and that works fine. So there must be a way of adding a file to a
directory and making it work.

"Scott Allen" wrote:
Well, you could just force them to login with thier windows account
using windows authentication. In that case you wouldn't need an
<authentication> element in the sub directory, but just an
<authorization> element to keep out anonymous users and only allow in
authenticated users. Know what I mean?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 10:33:01 -0800, dhnriverside <da*@musoswire.com>
wrote:
Yes it does. The main system using Windows Authentication. I'm try to create
a system to allow the user to update his/her Active Directory info (address,
tel, etc), but obviously I want them to login proper for that (security!).
Hence the directory, web app and web.config file.

Is there any way to make it work though? :)

"Scott Allen" wrote:
Does the main web site use a different authentication mechanism, like
Windows authentication?

If not, you can specify the specific sub directories to protect using
the inside a <location> element.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 2 Feb 2005 08:47:05 -0800, dhnriverside <da*@musoswire.com>
wrote:

>Ok, thats cool. But the web.config file (code below) said it needed to be an
>application, hence. This web.config overwrites parts of the web.config in the
>main app directory.
>
>I can I get round it wanting to be an application?
>
>Cheers
>
>
>Dan
>
>\secure\web.config...
>
><configuration>
> <system.web>
> <authentication mode="Forms">
> <forms
> name="ADupdateAuth"
> path="/"
> loginUrl="UpdateLogin.aspx"
> protection="All"
> timeout="30"
> />
> </authentication>
> <authorization>
> <deny users="?" />
> </authorization>
> </system.web>
></configuration>
>
>
>
>
>"Scott Allen" wrote:
>
>> Hey Dan:
>>
>> You probably do not want the secure subdirectory to be an application.
>> ..NET will assume it has it's own bin directory and is looking for a
>> dll in secure\bin to find the code for the aspx file.
>>
>> --
>> Scott
>> http://www.OdeToCode.com/blogs/scott/
>>
>> On Wed, 2 Feb 2005 07:45:07 -0800, dhnriverside <da*@musoswire.com>
>> wrote:
>>
>> >Hi peeps
>> >
>> >Ok, I've got a web application running (lets call it MyApp, so its namespace
>> >is MyApp). I've created a subdirectory within this application called
>> >"secure", and made than an Application in IIS too. Plus I've added another
>> >web.config in there.
>> >
>> >Then I added an aspx page (called UpdateLogin.aspx), which created itself in
>> >the namespace "MyApp.secure", but when I try to load this page im getting...
>> >
>> >"Parser Error Message: Could not load type 'MyApp.secure.UpdateLogin'."
>> >
>> >Here's the line it's failing on...
>> >
>> ><%@ Page language="c#" Codebehind="UpdateLogin.aspx.cs"
>> >AutoEventWireup="false" Inherits="MyApp.secure.UpdateLogin" %>
>> >
>> >All files are there, have tried taking out ".secure" from the namespace and
>> >the reference, have tried adding the directory to the Codebehind option, but
>> >all to no avail.
>> >
>> >What's going on?
>> >
>> >Cheers
>> >
>> >
>> >Dan
>>
>>


Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.