473,657 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enumerating Global Assemblies

Joy
Hi,

I am providing the users of my application with the ability to create
..Net scripts within the application. I want to enable them to select
the dlls and assemblies they will need to allow their scripts to run as
well. So I want to duplicate what Visual Studio does where it provides
a form with all the globally defined .net assemblies available for the
user to reference in their program.

I found where these global assemblies are located on my machine:
C:\WINDOWS\asse mbly

However, when I try to enumerate the assemblies with the following
code:

Dim d() As String =
System.IO.Direc tory.GetFiles(" C:\WINDOWS\asse mbly")

it is not able to capture any of those global assemblies - maybe
because they are pointers to the actual dll locations rather than
physical files themselves.

Anyway, all I want is a way to dynamically determine what globally
defined assemblies a user may or may not have on their machine and
display them to the user.

Does anyone know how I could do this??

Thanks!

Joy

Aug 4 '05 #1
1 1601
Unfortunately there is no simple way to do this via C#. The Global Assembly
Cache (GAC), the directory you're trying to enumerate, uses a "weird" file
structure that has also changed from version 1.1 to 2.0 of .NET. You nwould
normally use the methods provided in fusion.dll to access and manipulate the
GAC.

However, there is a very good fusion wrapper library available on the
CodeProject that would help you a lot. Check it out:
http://www.codeproject.com/csharp/GacApi.asp

Hope this helps!

Brian Delahunty

"Joy" wrote:
Hi,

I am providing the users of my application with the ability to create
..Net scripts within the application. I want to enable them to select
the dlls and assemblies they will need to allow their scripts to run as
well. So I want to duplicate what Visual Studio does where it provides
a form with all the globally defined .net assemblies available for the
user to reference in their program.

I found where these global assemblies are located on my machine:
C:\WINDOWS\asse mbly

However, when I try to enumerate the assemblies with the following
code:

Dim d() As String =
System.IO.Direc tory.GetFiles(" C:\WINDOWS\asse mbly")

it is not able to capture any of those global assemblies - maybe
because they are pointers to the actual dll locations rather than
physical files themselves.

Anyway, all I want is a way to dynamically determine what globally
defined assemblies a user may or may not have on their machine and
display them to the user.

Does anyone know how I could do this??

Thanks!

Joy

Aug 4 '05 #2

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

Similar topics

2
1684
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
5378
by: anders | last post by:
I already asked this question in the VB.NET group but as C# seems to have the same problem, I'll try here, too. I have 2 external OEM assemblies A1 and A2 that both define class X (same name, not same class) in the global namespace. I need to use both X'es in my project. How do I fully qualify the X'es to avoid the name clash between X from A1 and X from A2. The using statement provides a way of aliasing clashing names from named...
5
1986
by: Homer J. Simpson | last post by:
Hi, Any idea to get the -REAL- number of active users -WITHOUT- this kind of code ? ---------------------------------------------------------------------------- --------- Sub Session_OnStart Application.Lock Application("Active")=Application("Active")+1 Application.Unlock
5
15095
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
10
6649
by: anders | last post by:
I have 2 external assemblies A1 and A2 that both define class X in the global namespace. I need to use both assemblies in my VB project but the names X are ambiguous. How can I get around this problem? Is there a way to refer to the assembly, f.ex. A1.X and A2.X (this syntax does not compile). Or can I change the name X in the Imports directive? Again the problem is how do I refer to the 2 different X'es in assemblies A1 and A2:
1
259
by: Joy | last post by:
Hi, I am providing the users of my application with the ability to create ..Net scripts within the application. I want to enable them to select the dlls and assemblies they will need to allow their scripts to run as well. So I want to duplicate what Visual Studio does where it provides a form with all the globally defined .net assemblies available for the user to reference in their program. I found where these global assemblies are...
3
2276
by: sundew | last post by:
so here is the test case: <head> <script type='text/javascript'> // this function simply returns the number of enumerable namespaces(objects) function numNSpaces(){ var num = 0; for(var i in window) ++num;
11
8354
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the generated code on a W2K3 server the application_start and any other event on the global.asax file won't fire. I added tracing and logging to make sure and I can see the code is just not execution. When running the same exact (deployed etc.) code on...
6
2743
by: Piotrekk | last post by:
Hi In my solution I have two projects. First is Library project. The second project uses this library ( dll ). I am registering this assembly in global assembly cache ( by .net configuration tool ). Key pair is generated for the assembly using VS2005 ( I also use VS to sign my assembly using this keypair ) Everything works fine. I am adding reference to created dll, on the second project.
0
8421
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
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8518
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
8621
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
7354
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
6177
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
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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
1734
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.