473,506 Members | 16,970 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\assembly

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

Dim d() As String =
System.IO.Directory.GetFiles("C:\WINDOWS\assembly" )

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 1586
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\assembly

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

Dim d() As String =
System.IO.Directory.GetFiles("C:\WINDOWS\assembly" )

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
1679
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...
4
5368
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,...
5
1980
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...
5
14982
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
10
6633
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...
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...
3
2263
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...
11
8315
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...
6
2734
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...
0
7307
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,...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5035
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...
0
4701
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...
0
3188
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...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
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 ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
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...

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.