473,387 Members | 1,925 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.

Problem in using Assembly CreateInstance

Hi,

I want to create an Instance of Class using Assembly.CreateInstance
method. I have loaded my assmbly

Assembly exeAssmb = Assembly.LoadWithPartialName"CommonStructures");
//Assembly exeAssmb =
Assembly.LoadFrom("C:\\Inetpub\\wwwroot\\Vinoth\\C ommonStructures.dll");
Then when i create an Instance of the Assembly it giving Undefined
Value.
string instClass = "ManWrapper";
object inst =exeAssmb.CreateInstance(instClass);
//object inst =Activator.CreateInstance(exeAssmb.FullName,instCl ass);

This class(ManWrapper) is in CommonStructures and i registered it in
gacutil also.

I tried the Commentd line also. What is the problem? Is anybody knows
solution please let me know.

Thanks,
Vinoth

Nov 17 '05 #1
2 1806
Is ManWrapper in a namespace? You need to use the fully qualified name of the type.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi,

I want to create an Instance of Class using Assembly.CreateInstance
method. I have loaded my assmbly

Assembly exeAssmb = Assembly.LoadWithPartialName"CommonStructures");
//Assembly exeAssmb =
Assembly.LoadFrom("C:\\Inetpub\\wwwroot\\Vinoth\\C ommonStructures.dll");
Then when i create an Instance of the Assembly it giving Undefined
Value.
string instClass = "ManWrapper";
object inst =exeAssmb.CreateInstance(instClass);
//object inst =Activator.CreateInstance(exeAssmb.FullName,instCl ass);

This class(ManWrapper) is in CommonStructures and i registered it in
gacutil also.

I tried the Commentd line also. What is the problem? Is anybody knows
solution please let me know.

Thanks,
Vinoth
[microsoft.public.dotnet.languages.csharp]
Nov 17 '05 #2
Thank you so much,

Its a Class. Now its working with Namespace.ClassName. Previously i
tried with ClassName alone.

Once again thankyou

Nov 17 '05 #3

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

Similar topics

0
by: Stephane Belzile | last post by:
Hi, I have been trying for more than 3 days to load an assembly and execute a method from a specific class. Loading the assembly from the GAC using it's strong name works fine but when I try to...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
0
by: samlee | last post by:
Hi All, I'm learning how to write C# using reflection, but don't know how to code using reflection this.Controls.Add(this.label1); Could anyone help, Thank in advance. ...
4
by: Terry | last post by:
I'm building some dll assemblies that have in them the implementation of an abstract class defined in a different assembly. I'm trying to create objects of the type defined in the dlls with...
6
by: Simon Verona | last post by:
I would normally use code such as : Dim Customer as new Customer Dim t as new threading.thread(AddressOf Customer.DisplayCustomer) Customer.CustomerId=MyCustomerId t.start Which would create...
6
by: CreateObject | last post by:
Assume that I have the classes below; class mercedes: IAuto { .... } class ford: IAuto{ .... }
1
by: Damien \zaide\ Desmarets | last post by:
Hi, I have a little problem with the 2.0 framework. I use a web farm with 2003 server and IIS. I have installed SFU 3.5 to use NFS on windows, it works great with ASP.NET 1.1 and IIS 6.0. So I...
2
by: Peted | last post by:
I have 2 samples of code bellow that work fine at the moment the first routine loads an dll assembley and instantiates the type in the dll which is always a form, and creates a child form from...
0
by: xievvv | last post by:
I'm working on a COM add-in project for Office. Because I don't want the overheard of VSTO, I'm going with the approach of using a C++ shim, as created by the wizard provided by MS for generating...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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
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.