473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1580
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
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
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
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
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
10
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.