C# partial classes - get the namespace as a type!

G

Guest

Hi guys

I'm using .net 2, partial classes.

I've got a function (not mine unfortunately, it's in a dll) and I need to
pass this function a Type - the Type of my namespace.

I can get the namespace name with...

System.Reflection.Assembly.GetAssembly(typeof(<myclass>)).GetName().Name.ToString()

But how to I get this into the function when it wants a type? If I add
GetType in front of that, I get null.

How can I turn the name of the namespace that's been generated into a type
so that the function will work?!

Cheers


Dan
 
K

Karl Seguin [MVP]

A namespace isn't a type and thus can't be converted to one. A namespace is
a string and only a string. Types are classes, structs, enums, events and a
few others...but not namespaces.

Karl
 

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

Top