[Mono-list] XSP and Bin Directory

John Anderson sontek at gmail.com
Tue Nov 7 11:31:47 EST 2006


I was wondering if there is a reason XSP doesn't load libraries that
are in its Bin\ directory?

I created a simple web application with 1 page "HelloWorld.aspx"  and
it calls the library in its Bin\ Directory   HelloWorldApi.Say("Hi
World");  and I get "Can't find HelloWorldApi"  even though its in the
bin directory.   So then I created a global.asax file:

<%@ Application Language="C#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Reflection" %>
<%@ Import Namespace="System.Security.Policy" %>
<script runat="server" >
public void Session_Start(object sender, EventArgs e)
{
            AppDomain currentDomain = AppDomain.CurrentDomain;
        //Provide the current application domain evidence for the assembly.
        Evidence asEvidence = currentDomain.Evidence;
        //Load the assembly from the application directory using a simple name.

        //Make an array for the list of assemblies.
        Assembly[] assems = currentDomain.GetAssemblies();
        foreach (Assembly assem in assems)
                Response.Write(assem.ToString());
}
</script>


and the Library does not show as being loaded:

7ab2d425, Version=0.0.0.0, Culture=neutrale218620, Version=0.0.0.0,
Culture=neutralSystem.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3aSystem.Web.Services, Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3aSystem.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089System.Configuration,
Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3aMono.Security, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=0738eb9f132ed756System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3aSystem, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089Mono.WebServer2, Version=0.2.0.0,
Culture=neutral,
PublicKeyToken=0738eb9f132ed756mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089


More information about the Mono-list mailing list