473,811 Members | 3,256 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.net assembly locating

Previously I was building websites using asp. I have a folder name
"projects", under the projects folder, I have number of subfolders,
each subfolder represent a website I'm building. Inside each
subfolder, I would have varies files for that website such as asp,
images.

This works fine for asp websites, all I have to is create one virtural
directory in IIS for the projects folder and I can access each
websites that I'm building by "/projects/folder name"

Now, I switching to ASP.NET, I would have to create a virtual
directory for each of the subfolder under the projects folder,
otherwise it will not able to find the assemblies for the website.

Is there any way to get around that? I was thinking of using
AssemblyResolve event in the global.asax file to dynamically load the
assemblies, but this doesn't seems to work.
Nov 19 '05 #1
6 1726
> Now, I switching to ASP.NET, I would have to create a virtual
directory for each of the subfolder under the projects folder,
otherwise it will not able to find the assemblies for the website.


just put all the binaries in the main folder's \bin subfolder. they should
be accessible from any subdirectory of the main application's directory. I
think that this is a general rule : asp.net searches for assemblies only in
\bin subfolder of the application's main folder.

Wiktor Zychla
Nov 19 '05 #2
Dugan:

You'll face an uphill battle trying to load assemblies from outside
the bin subdirectory of a web app, I'd try to avoid the complications.

Having said that, as long as all the assemblies you need are in a
subdirectory (private assemblies) - you can add a probing path to
web.config. For example, this would pull an assembly from a
sub-application's bin dir:

<configuratio n>
<runtime>
<assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
<probing privatePath="Su bApplication/bin" />
</assemblyBinding >
</runtime>
<configuratio n>

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

On 22 Dec 2004 22:59:57 -0800, du*********@hot mail.com (Dugan Zhang)
wrote:
Previously I was building websites using asp. I have a folder name
"projects", under the projects folder, I have number of subfolders,
each subfolder represent a website I'm building. Inside each
subfolder, I would have varies files for that website such as asp,
images.

This works fine for asp websites, all I have to is create one virtural
directory in IIS for the projects folder and I can access each
websites that I'm building by "/projects/folder name"

Now, I switching to ASP.NET, I would have to create a virtual
directory for each of the subfolder under the projects folder,
otherwise it will not able to find the assemblies for the website.

Is there any way to get around that? I was thinking of using
AssemblyResolv e event in the global.asax file to dynamically load the
assemblies, but this doesn't seems to work.


Nov 19 '05 #3
I have look at configuration for probing, but that only seems to work
for non asp.net application. For asp.net website, it seems to ignore
the privatepath and only look for the assemblies in bin directory.

Nov 19 '05 #4
Could you provide an example? I've seen this approach work.

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

On 23 Dec 2004 17:36:09 -0800, du*********@hot mail.com wrote:
I have look at configuration for probing, but that only seems to work
for non asp.net application. For asp.net website, it seems to ignore
the privatepath and only look for the assemblies in bin directory.


Nov 19 '05 #5
You can see the exampe at http://69.199.167.164/projects/test2/

test2 is folder under the projects folder, in test2, I have the
web.config file set as following

<configuratio n>
<runtime>
<assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
<probing privatePath="te st2\bin"/>
</assemblyBinding >
</runtime>
</configuration>

I have try several different privatePath, such as /test2/bin,
test2\\bin, but none of them work.

Nov 19 '05 #6
If the code for a page is not in a bin directory assembly you should
use the @Assembly directive in the page:

http://msdn.microsoft.com/library/de...tivesyntax.asp

So, the way you have your config file setup, you want asp.net to look
in test2\test2\bin ?

--
Scott
http://www.OdeToCode.com/blogs/scott/
On 25 Dec 2004 18:31:09 -0800, du*********@hot mail.com wrote:
You can see the exampe at http://69.199.167.164/projects/test2/

test2 is folder under the projects folder, in test2, I have the
web.config file set as following

<configuration >
<runtime>
<assemblyBindi ng xmlns="urn:sche mas-microsoft-com:asm.v1">
<probing privatePath="te st2\bin"/>
</assemblyBinding >
</runtime>
</configuration>

I have try several different privatePath, such as /test2/bin,
test2\\bin, but none of them work.


Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1276
by: M. Fitzgerald | last post by:
Our migration from ASP to ASP.NET will be a slow one. In themeantime, I have constructed a .NET assembly and registered itas a COM object for use in out classic ASP pages. One of thethings this particular assembly does is use Reflection todynamically load another assembly (based of course onuser-provided parameters). The original error is in that it could not locate the assembly tobe loaded. I've tried placing the dynamically loaded...
2
1806
by: e_zverev | last post by:
Hi The question concerns the ways ASP.NET loads required assemblies into it's app domain. I know of a deprecated feature of clr assembly detection in which the use of environment variable DEVPATH is involved. My problem is that this way doesnot seem to work when I need to locate an assembly in my ASP.NET application. Does the DEVPATH feature have to work in ASP.NET?
1
10809
by: urs | last post by:
Two days ago, I built an ASP.NET 2.0 application and published it on a shared IIS 6 Web server. After publishing, and during the whole day, it worked fine. The server remained untouched since. Today, I wanted to access the home page of the application again with a browser. But instead of the proper page, I just got an ugly message: Server Error in '/' Application.
8
1395
by: Dale | last post by:
I have created a class that implements IHttpModule and I want to use the module on several of the web sites that exist on my server. The module works great if I place the dll in a web applications bin directory. However, I can’t get it to work at all from the GAC. If I remove the dll from the web applications bin file, I get the following error: File or assembly name RequestHandler, or one of its dependencies, was not found. The...
1
2483
by: OrionLee | last post by:
I am using C# to work with a 3rd party DLL (Nevron Charts), and attempting to serialise it. The serialisation itself is handled somewhere inside the DLL, so to get it to happen you call the Nevron's serialiser and then SaveToStream() which will serialises the chart object into a stream for you, which is all well and good... Now for the problem: If I create a standalone application and use the serialiser to serialise charts it all works fine....
0
9731
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.