GetType() from a static class

  • Thread starter Thread starter sklett
  • Start date Start date
S

sklett

I'm moving some functions that are littered in various inappropriate classes
into a single, static utility class.

I ran into a problem with this line:
<code>
Assembly thisAssembly = Assembly.GetAssembly(this.GetType());
</code>

Looks like I don't have access to the 'this' reference (duh), but I can't
find out how else to use GetType() on a static class? Anyone have any
ideas?
 
sklett said:
I'm moving some functions that are littered in various inappropriate classes
into a single, static utility class.

I ran into a problem with this line:
<code>
Assembly thisAssembly = Assembly.GetAssembly(this.GetType());
</code>

Looks like I don't have access to the 'this' reference (duh), but I can't
find out how else to use GetType() on a static class? Anyone have any
ideas?

Use typeof(TypeName).
 
Thanks for the help all, sorry I didn't get my response out sooner that I
had solved it.
Have a good weekend,
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top