473,770 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing Assemblies not contained in the Web App

Hello,

I created a simple C# library assembly that exposes general facilities I
would like to use in my ASP.NET web applications. If I added the assembly
into the bin directory of my asp.net app, the runtime finds the assembly
without a problem and resolves any references to the classes exposed by the
assembly. However, I do not wish to deploy the assembly into each bin
directory for each web application. I would like to specify the library
assembly in a "global" directory on my web server. (By global I'm referring
to a directory that is not part of any web application.) Then each web
application that references my custom assembly will reference the only copy
of the assembly found in a global directory. The problem I'm having is that
my ASPX module does not like assembly directives that point to assemblies
outside the web application. I tried modify the application web.config file
to include a <codebase> and <probing> element in the configuration's runtime
element but without success. So, is it possible to reference "global"
assemblies? If so, how should the web.config file be setup?

Thanks for you time,
Mike M.
Nov 17 '05 #1
2 2122
It sounds like you should install your shared library to the Global Assembly
Cache (GAC)

Here's more info:
http://msdn.microsoft.com/library/de...emblycache.asp
http://msdn.microsoft.com/library/de...emblyCache.asp
http://www.aspzone.com/articles/john/GAC/

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Mike M" <ma******@earth link.net> wrote in message
news:%2******** ************@TK 2MSFTNGP10.phx. gbl...
Hello,

I created a simple C# library assembly that exposes general facilities I
would like to use in my ASP.NET web applications. If I added the assembly
into the bin directory of my asp.net app, the runtime finds the assembly
without a problem and resolves any references to the classes exposed by the assembly. However, I do not wish to deploy the assembly into each bin
directory for each web application. I would like to specify the library
assembly in a "global" directory on my web server. (By global I'm referring to a directory that is not part of any web application.) Then each web
application that references my custom assembly will reference the only copy of the assembly found in a global directory. The problem I'm having is that my ASPX module does not like assembly directives that point to assemblies
outside the web application. I tried modify the application web.config file to include a <codebase> and <probing> element in the configuration's runtime element but without success. So, is it possible to reference "global"
assemblies? If so, how should the web.config file be setup?

Thanks for you time,
Mike M.

Nov 17 '05 #2
I'll have to see if my web hosting service provider is willing to add
assemblies to the GAC. Unfortunately, I'm kinda at the mercy of an
out-sourced production environment. That's why I'm looking for a self
contained method for accessing assemblies.

Thanks for the help.
"Steve C. Orr, MCSD" <St***@Orr.ne t> wrote in message
news:#X******** ******@TK2MSFTN GP10.phx.gbl...
I can't say for sure if it's the only way, I can only say that it is the
right way.
This is exactly what the GAC was designed for. I suggest you use it unless it has some specific shortcoming that does not meet your requirements.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Mike M" <ma******@earth link.net> wrote in message
news:uG******** ******@TK2MSFTN GP12.phx.gbl...
Hi Steve,

Yes, that would probably solve the problem but is that the only solution
available? Is there no way to structure
the web.config file to search outside the current web application?

Thanks,
Mike
"Steve C. Orr, MCSD" <St***@Orr.ne t> wrote in message
news:eb******** ******@TK2MSFTN GP12.phx.gbl...
It sounds like you should install your shared library to the Global Assembly
Cache (GAC)

Here's more info:

http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconglobalasse mblycache.asp

http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxconInstalling ToGlobalAssembl yCache.asp
http://www.aspzone.com/articles/john/GAC/

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Mike M" <ma******@earth link.net> wrote in message
news:%2******** ************@TK 2MSFTNGP10.phx. gbl...
> Hello,
>
> I created a simple C# library assembly that exposes general facilities I
> would like to use in my ASP.NET web applications. If I added the

assembly
> into the bin directory of my asp.net app, the runtime finds the assembly > without a problem and resolves any references to the classes exposed by the
> assembly. However, I do not wish to deploy the assembly into each
bin > directory for each web application. I would like to specify the

library > assembly in a "global" directory on my web server. (By global I'm
referring
> to a directory that is not part of any web application.) Then each web > application that references my custom assembly will reference the only copy
> of the assembly found in a global directory. The problem I'm having is that
> my ASPX module does not like assembly directives that point to

assemblies
> outside the web application. I tried modify the application web.config file
> to include a <codebase> and <probing> element in the configuration's
runtime
> element but without success. So, is it possible to reference "global" > assemblies? If so, how should the web.config file be setup?
>
> Thanks for you time,
> Mike M.
>
>



Nov 17 '05 #3

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

Similar topics

0
1414
by: S Arnold | last post by:
Magic Software invites you to join us this coming Tuesday (February 24th, 2004) at 12:00 EDT / 17:00 GMT for a FREE live Webinar: Accessing .NET assemblies via eDeveloper Title: Accessing .NET assemblies via eDeveloper Date: February 24, 2004 Time: 12:00 PM EST / 17:00 GMT Presenter: Ofer Spiegel
2
6986
by: msnews.microsoft.com | last post by:
How can we access an internal class in a referenced file in a multi-file assembly. All documentation states the obvious purpose of the internal keyword on a class, but when referencing an assembly, I fear it means single-file assembly. That means even if the assembly is strong-named and versioned, it will not reach internal classes. So much for code reuse while hiding classes from external objects. I can't find examples or explanations...
2
1690
by: Abdessamad Belangour | last post by:
Hi all, and thanks for previous answers (especially Nicholas Paldino) An assembly is composed of a set of modules. The module class has a method for reading global methods GetMethods(). My questions are : 1. Are we obliged to go down to modules for reading global methods? 2. What about the GetExportedTypes() method of an assembly class ? 3. Should we ignore global methods as we are C# users (not C++) and that we are interested in...
4
14494
by: Jimi | last post by:
Given a C# project file path, can I use reflection to get all the assemblies referenced by the project? e.g., I know the path of a C# project, say, "c:\SomeProject.csproj", and I want to load its referenced assemblies to construct a list of their members for display. Note that "c:\SomeProject.csproj" is not the current project, it's just a project we're displaying information about in the utility I'm trying to construct.
2
7280
by: franzhe | last post by:
Hi all, in a simple ASP.Net application with resources in satellite assemblies I have the following problem: If I set <identity impersonate="true"/>, accessing a culture specific resource from a satellite assembly fails with the error message: "Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. ..."
2
1393
by: Willy | last post by:
Hi All! Is there any ways to get access to the controls contained in another user controls from an ASP.NET page? For example I have... - User Control A |_ User Control B (which uses User Control A) |_ User Control C (which uses User Control B)
2
1357
by: John | last post by:
Hi What are assemblies and what purpose do they serve? Thanks Regards
1
1362
by: Craig | last post by:
My team is building an application in VS.NET 2005. To avoid a monolithic app and spread the development workload, we have a relatively small framework application that instantiates module assemblies as needed; each "module" is a relatively independent silo with its own UI, BL, and DAL that shares a common DB. The DB connection string is an app setting in the app.config. How can I access the connection string from the assemblies, either by...
2
5114
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application = Windows Forms class B = a singleton hosted within A. B is responsible for dynamically loading classes X, Y, and Z.
0
9602
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
10237
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...
0
9882
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
8905
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
7431
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...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3987
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
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.