Click here to Skip to main content
16,005,121 members
Home / Discussions / C#
   

C#

 
GeneralRe: File segmentation Pin
Heath Stewart19-Mar-04 6:09
protectorHeath Stewart19-Mar-04 6:09 
GeneralSomething unclear to me about threads... Pin
profoundwhispers19-Mar-04 5:43
profoundwhispers19-Mar-04 5:43 
GeneralRe: Something unclear to me about threads... Pin
Heath Stewart19-Mar-04 6:01
protectorHeath Stewart19-Mar-04 6:01 
GeneralStrong/Shared assemblies Pin
Kant19-Mar-04 4:57
Kant19-Mar-04 4:57 
GeneralRe: Strong/Shared assemblies Pin
Heath Stewart19-Mar-04 5:59
protectorHeath Stewart19-Mar-04 5:59 
GeneralRe: Strong/Shared assemblies Pin
Kant19-Mar-04 10:36
Kant19-Mar-04 10:36 
GeneralRe: Strong/Shared assemblies Pin
Heath Stewart21-Mar-04 12:52
protectorHeath Stewart21-Mar-04 12:52 
GeneralLoading assemblies Pin
Craig G. Wilson19-Mar-04 4:55
Craig G. Wilson19-Mar-04 4:55 
I am having an issue loading an assembly. Two days ago, this exact same code was working. Today, I cannot, for the life of me, get the module to load. Here is the relevant code:
public ArrayList FindModules(string path,Type type)
{
	ArrayList modulesFound = new ArrayList();
	foreach(string file in Directory.GetFiles(path))
	{
		FileInfo fileInfo = new FileInfo(file);
		if (fileInfo.Extension == ".dll")
		{
			Assembly assembly = Assembly.LoadFrom(file);
			foreach(Type t in assembly.GetTypes())
	                {
				if(modulesFound.Contains(file))
				 break;
				foreach(Type iFace in t.GetInterface())
				{
					if(iFace.Equals(IModule))
					{
						modulesFound.Add(file);
						break;
					}
				}
			}
		}
	}
	return modulesFound;
}


The problem is with the if(iFace.Equals(type)) line. It doesn't recognize that iFace is the same as IModule. If the line is changed to iFace.Name == "IModule" , the it loads the module, but returns a null instance.

Any Ideas????

Thanks,
Craig Wilson
GeneralRe: Loading assemblies Pin
Heath Stewart19-Mar-04 5:56
protectorHeath Stewart19-Mar-04 5:56 
GeneralRe: Loading assemblies Pin
Craig G. Wilson19-Mar-04 8:03
Craig G. Wilson19-Mar-04 8:03 
GeneralRe: Loading assemblies Pin
Craig G. Wilson19-Mar-04 8:34
Craig G. Wilson19-Mar-04 8:34 
GeneralRe: Loading assemblies Pin
Heath Stewart21-Mar-04 12:36
protectorHeath Stewart21-Mar-04 12:36 
Generalcombobox databinding from webservice in mobile application Pin
Littlefool19-Mar-04 2:43
Littlefool19-Mar-04 2:43 
GeneralCreating virtual File Item in C# Pin
Tristan Rhodes19-Mar-04 2:17
Tristan Rhodes19-Mar-04 2:17 
GeneralRe: Creating virtual File Item in C# Pin
Heath Stewart19-Mar-04 4:34
protectorHeath Stewart19-Mar-04 4:34 
GeneralRe: Creating virtual File Item in C# Pin
Tristan Rhodes19-Mar-04 6:04
Tristan Rhodes19-Mar-04 6:04 
GeneralRe: Creating virtual File Item in C# Pin
Heath Stewart19-Mar-04 6:19
protectorHeath Stewart19-Mar-04 6:19 
GeneralRe: Creating virtual File Item in C# Pin
Tristan Rhodes19-Mar-04 8:15
Tristan Rhodes19-Mar-04 8:15 
GeneralRe: Creating virtual File Item in C# Pin
Heath Stewart21-Mar-04 12:43
protectorHeath Stewart21-Mar-04 12:43 
GeneralVS .Net Pin
ppp00118-Mar-04 23:05
ppp00118-Mar-04 23:05 
GeneralRe: VS .Net Pin
Mazdak18-Mar-04 23:20
Mazdak18-Mar-04 23:20 
GeneralRe: VS .Net Pin
Rhys__66618-Mar-04 23:31
Rhys__66618-Mar-04 23:31 
GeneralRe: VS .Net Pin
Mazdak19-Mar-04 9:37
Mazdak19-Mar-04 9:37 
GeneralRe: VS .Net Pin
Heath Stewart19-Mar-04 4:22
protectorHeath Stewart19-Mar-04 4:22 
GeneralRe: VS .Net Pin
profoundwhispers19-Mar-04 5:45
profoundwhispers19-Mar-04 5:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.