473,406 Members | 2,847 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,406 software developers and data experts.

Discovering the assembly names in your project ?

Hi ,

Just wondering is there a simple way to extract the names of all the
assemblies placed in your bin folder ?

thanks in advance..

May 10 '06 #1
2 1064

"vivekian" wrote...
Just wondering is there a simple way to extract the names of all the
assemblies placed in your bin folder ?


Maybe something like this, feed it with a DirectoryInfor corresponding to
your folder...

....

using System.Reflection;
using System.IO;

....

private ArrayList LoadAssemblies(DirectoryInfo d)
{
ArrayList assemblyNames = new ArrayList();

if (!d.Exists) return assemblies;

FileInfo[] ff = d.GetFiles("*.dll");

int assemblies = ff.Length;

foreach (FileInfo f in ff )
{
string name = LoadAssembly( f );
if ( name != null )
{
assemblyNames.Add(name);
}
}
}

private bool LoadAssembly(FileInfo f)
{
string name = null;
try
{
Assembly a = Assembly.LoadFrom(f.FullName);
name = a.FullName;
}
catch (Exception ex) // Ignore non-loadable dll:s
{
return null;
}
return name;
}

--------------------------------------------

// Bjorn A
May 10 '06 #2

This will list the modules that are currently loaded.

foreach (ProcessModule Module in (Process.GetCurrentProcess()).Modules)
{ Console.WriteLine(Module.ModuleName);
}
May 13 '06 #3

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

Similar topics

5
by: Abdul | last post by:
I am working on a .net project and need some help. The project contains different components. Each component is in its privated assembly. For e.g Component1 is a C# library project in VS.net and...
3
by: edge | last post by:
Is there any way to Assembly.Load() dynamically the DLLs of my project, with their strong names, but without the need to specify a version? I just want the public/private key to exist as a measure...
3
by: Dan | last post by:
Hi, I have a problem using an aspx page with a Control on it. I get the following error message Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple places; using definition...
3
by: Jim | last post by:
Hi, I have an assembly and it's satellite in my GAC. I have referenced the DLLs in my project (from the same location where I added it to the GAC). CopyLocal is set false. When I run the...
0
by: Eric Barr | last post by:
I saw a small number of old threads about a strange build error, but never saw a solution. I just spent about 4 hours debugging this so i hoped i could help out people who come across this...
2
by: john | last post by:
Maybe I haven't had that "a-ha" moment yet, but I think the new approach to web projects is a step in the wrong direction. My main beef is that control over the assembly generation process has...
0
by: mschep | last post by:
Hi, I built an assembly with a set of user controls. This can be done with the Visual Studio 2005 Deployment Project: building and merging for example all your aspx and ascx in one dll (lets...
3
by: vivekian | last post by:
Hi , Just wondering is there a simple way to extract the names of all the assemblies placed in your bin folder ? thanks in advance..
14
by: Monty | last post by:
Hello, I have created a solution which has both a web UI and a winform UI, the latter is just for administrators. The Web UI (a Web Application Project) and the winform project both...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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
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...
0
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...

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.