471,627 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Using Type.GetType in an already loaded assembly

TN
I have an application that is using System.Windows.Forms. I'd like to
use Type.GetType() to get a Type so I can create an instance of it using
reflection. The only way I can get it to return the type is:

Type tt = Type.GetType(
"System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089");

Since (I assume) when my application is running System.Windows.Forms
assembly is already loaded, there must be a way to get the type from the
loaded assembly, instead of having to specify version/culture/token
information.
Can anyone shed some light on this dim bulb?
Thanks.
Jan 26 '06 #1
1 1767
1. obtain assembly reference for example from
AppDomain.GetAssemblies
2. search type in well-defined assembly
Assembly.GetType

Jan 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by MarkB | last post: by
16 posts views Thread by Andrew Ducker | last post: by
1 post views Thread by lit | last post: by
4 posts views Thread by Dan Manges | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

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.