Assembly probing does not work

P

Pavils Jurjans

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
 
D

David Jessee

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

Pavils Jurjans

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top