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

Assembly probing does not work

P: n/a
Hello,

This is my test.aspx page:

<%@ Page Language="C#" enableSessionState="true" inherits="MyPage"%>

This is code in CodeBehind.cs:

using System;

public class MyPage : System.Web.UI.Page
{
public void Page_Load(Object sender, EventArgs e)
{
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
System.Web.HttpContext currentContext = System.Web.HttpContext.Current;
currentContext.Response.Write("Hello");
}
}

The CodeBehind.cs is compiled to CodeBehind.dll, and saved in "<application
root>/bin/test" folder

The web.config file is this:

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin\test"/>
</assemblyBinding>
</runtime>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

Yet, when I try to look at test.aspx page, I get "Could not load type
'MyPage'" error.

What am I doing wrong here?

Thanks,

-- Pavils
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The Code is fine. Its the @Page directive. in the inherits attribute, put
the fully qualifies name of the class

"Pavils Jurjans" <pa****@mailbox.riga.lv> wrote in message
news:eF**************@TK2MSFTNGP11.phx.gbl...
Hello,

This is my test.aspx page:

<%@ Page Language="C#" enableSessionState="true" inherits="MyPage"%>

This is code in CodeBehind.cs:

using System;

public class MyPage : System.Web.UI.Page
{
public void Page_Load(Object sender, EventArgs e)
{
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
System.Web.HttpContext currentContext = System.Web.HttpContext.Current;
currentContext.Response.Write("Hello");
}
}

The CodeBehind.cs is compiled to CodeBehind.dll, and saved in "<application root>/bin/test" folder

The web.config file is this:

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin\test"/>
</assemblyBinding>
</runtime>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

Yet, when I try to look at test.aspx page, I get "Could not load type
'MyPage'" error.

What am I doing wrong here?

Thanks,

-- Pavils

Nov 18 '05 #2

P: n/a
Hello David,

Well, I have put the MyPage in the "Testing" namespace, and replaced aspx
with

<%@ Page Language="C#" enableSessionState="true" inherits="Testing.MyPage"%>

It still fails with "Could not load type 'Testing.MyPage'". Actually I tried
to engange the fusion log to check for error source, but it does not show
any entries.

I should note that I am testing not root (http://localhost), but a
separately specified application, ie http://localhost/testApp . Not that I
believe this is the source of problem, but just to give full information
about my setup. I know that web.config is actually being read, as when it's
not proper XML, I get error in the browser. I know that my DLL is Ok, as
it's working, if located diretly in bin folder.

Do I have somehow to tell ASP.NET the location of the DLL? I was expecting
that usual probing methods would work fine, and it would look in the folders
specified in the web.config file.

Please, help me to clarify this. This should have been so simple, but now my
project is being hesitated due to this problem.

Thanks,

Pavils
"David Jessee" <da**********@hotmail.com> wrote in message
news:m5*******************@fe2.texas.rr.com...
The Code is fine. Its the @Page directive. in the inherits attribute, put
the fully qualifies name of the class

"Pavils Jurjans" <pa****@mailbox.riga.lv> wrote in message
news:eF**************@TK2MSFTNGP11.phx.gbl...
Hello,

This is my test.aspx page:

<%@ Page Language="C#" enableSessionState="true" inherits="MyPage"%>

This is code in CodeBehind.cs:

using System;

public class MyPage : System.Web.UI.Page
{
public void Page_Load(Object sender, EventArgs e)
{
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
System.Web.HttpContext currentContext = System.Web.HttpContext.Current; currentContext.Response.Write("Hello");
}
}

The CodeBehind.cs is compiled to CodeBehind.dll, and saved in

"<application
root>/bin/test" folder

The web.config file is this:

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin\test"/>
</assemblyBinding>
</runtime>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

Yet, when I try to look at test.aspx page, I get "Could not load type
'MyPage'" error.

What am I doing wrong here?

Thanks,

-- Pavils


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.