• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 657
  • Last Modified:

How to get all the assemblies information from the project

I want to create the instance of type that is present in another assembly by using reflection.can any body help me on how to create the instance that is present in another assembly....
0
mskeerthi
Asked:
mskeerthi
  • 3
  • 3
1 Solution
 
Gautham JanardhanCommented:

Assembly assembly = Assembly.Load(System.IO.File.ReadAllBytes("FileName"));
            Type Type = assembly.GetType("MyType");
            object typeObject = Activator.CreateInstance(Type);

Open in new window

0
 
mskeerthiAuthor Commented:
when i am creating by using like this.in another project it is giving the error that

Error:Unable to cast object of type 'DfgClient.DfgService.InitDossierReq' to type 'DfgClient.DfgService.InitDossierReq'.

iam  doing the type casting like this:
 internal object InitDossier(object initrequest)
 {
             InitDossierReq request = (InitDossierReq)initrequest;
}

what can i do for this.
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
Gautham JanardhanCommented:
the likely casue would be that ur assembly versions are  different..
0
 
mskeerthiAuthor Commented:
Excellent Solution for the problem
0
 
mskeerthiAuthor Commented:
I am trying to get the referenced assemblies by using reflection.but all my assembiles are not showing can anyone sent what will be reason ?
0
 
Gautham JanardhanCommented:
this will give u all the loaded assemblies

AppDomain.CurrentDomain.GetAssemblies();
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now