469,935 Members | 1,600 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,935 developers. It's quick & easy.

<PrivateImplementationDetails>

I was looking at some commercial assemblies that we had purchased through
Lutz Roeder's .Net Reflector, and noticed this entry in some of them.

What is it and how does it get there?

Also, under this same namespace node (no name) there is an internal class.
How does one go about putting an internal class under this non-identified
namespace? (it's the same one where you find the <Module> and AssemblyRef
classes.

David
Jul 21 '05 #1
3 11984
I did a little more digging (experimenting) and it looks like the internal
class is in the AssemblyInfo.cs file, which leads me to another question.
Why would you want to define a class in that file? Would this be like a
global definition? Is this safe?

If you have answers to these or the original <PrivateImplementationDetails>
question, please respond. I'm trying to learn as many tricks of the trade
as I can.

Thanks again,
David

"dm_dal" <RE******************@yahoo.com> wrote in message
news:eK**************@TK2MSFTNGP15.phx.gbl...
I was looking at some commercial assemblies that we had purchased through
Lutz Roeder's .Net Reflector, and noticed this entry in some of them.

What is it and how does it get there?

Also, under this same namespace node (no name) there is an internal class.
How does one go about putting an internal class under this non-identified
namespace? (it's the same one where you find the <Module> and AssemblyRef
classes.

David

Jul 21 '05 #2
I did a little more digging (experimenting) and it looks like the internal
class is in the AssemblyInfo.cs file,
If you only have the compiled assembly and not the source or debug
symbols, how can you know which source file a class originates from?

Why would you want to define a class in that file? Would this be like a
global definition? Is this safe?


AssemblyInfo.cs is just another source file. Types defined there are
no less safe or more global than in other files.

I was looking at some commercial assemblies that we had purchased through
Lutz Roeder's .Net Reflector, and noticed this entry in some of them.

What is it and how does it get there?
It's a compiler generated class. It can be generated for example to
store array initialization data such as for code like this

int[] ints = {1,2,3,4,5};

Also, under this same namespace node (no name) there is an internal class.
How does one go about putting an internal class under this non-identified
namespace?


Just don't put it inside a namespace {} block.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 21 '05 #3
If you only have the compiled assembly and not the source or debug
symbols, how can you know which source file a class originates from?
Trial and error. Since it appears with the <Method> and <AssemblyRef>
information and I believe this is set from the assembly manifest
(AssemblyInfo.cs) then I assumed that's where it was. I tried it with one
of my Assemblies and got the same results.
AssemblyInfo.cs is just another source file. Types defined there are
no less safe or more global than in other files.
I guess by my "more global" question I was really refering to the fact that
it could be used from any class, from within any namespace in your assembly,
without having to include a "using" statement for the namespace or typing
out the fully qualified type definition when you use it. Such as:

System.Windows.Forms.Form
if Form was defined in the AssemblyInfo.cs, any of your classes could use it
by just typing "Form"
It's a compiler generated class. It can be generated for example to
store array initialization data such as for code like this

int[] ints = {1,2,3,4,5};


So how do you tell the compiler to generate the
<PrivateImplementationDetails> class and where does it get the information
it needs?
Also, under this same namespace node (no name) there is an internal class. How does one go about putting an internal class under this non-identified namespace?


Just don't put it inside a namespace {} block.


That makes sense.

David Young
Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.