ASPNET and bin directory.

A

Al

Hello,
I am trying to create a simple asp.net application, then rename the bin
directory and/or create another subdirectory with a bin folder.

I then add the following to the web.config file

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="subdir\bin;bin2"/>
</assemblyBinding>
</runtime>

When I browse the site, all I get is
Parser Error Message: Could not load type 'TestAspNet.Global'.

Source Error:

Line 1: <%@ Application Codebehind="Global.asax.cs"
Inherits="TestAspNet.Global" %>



IOW, I can't seem to get the probing to work.
Am I forced to use the bin directory under IIS application or is there
some way to reference another directory?

Al...
 
S

Steven Cheng[MSFT]

Hi AI,


Thanks for posting in the community!
From your description, you'd like to use the <probing> element in
web.config so as to specify a customized sub directory for the ASP.NET
runtime to locate the private assemblies. However, you found the setting
didn't work, the runtime still couldn't locate the assemblies via the
correct setting, yes?
If there is anything I misunderstood, please feel free to let me know.

As for this problem, it is because the ASP.NET runtime AppDomain's
"RelativeSearchPath" is always "bin" no matter how we set in the
web.config. To confirm this, you may try output the Runtime AppDomain's
RelativeSearchPath attribute via the following code:

Response.Write("AppDomain.CurrentDomain.RelativeSearchPath: " +
AppDomain.CurrentDomain.RelativeSearchPath);

We'll find that the value is "bin" though we set the web.config as:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="MyBin;Bin" />
</assemblyBinding>
</runtime>

BTW, would you like to try using the "codebase" to specify the runtime
location for the assemblies, since the codebase element will work for
ASP.NET application?

Please check out my suggestions. If you feel anything unclear, please feel
free to post here.



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

Hi AI,


Have you had a chance to check out my suggestions in the last reply or have
you got any further progress on this issue?
If you need any assitance, please feel free to let me know.



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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

Top