Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I found a sample code on internet. It was using few API which are not default in mvc 4. When I clicked on 'go to definition' then it showed some helper class [from Metadata]. When I located this class, it was in the AppData->Temp. I wanted to ask, how there classes are generated and if I create a new project how can i create that.
Posted
Comments
Nathan Minier 8-Sep-14 10:08am    
Too non-specific. Metadata classes in that context usually refer to Visual Studio Metadata, or it might refer to entity Framework. Please say what you're trying to actually do.
Sergey Alexandrovich Kryukov 8-Sep-14 10:16am    
Maybe OP simply looked for declarations of some type, and Visual Studio showed them "from metadata". (There is no such thing as "Visual Studio Metadata", by the way.) If this is the case, the problem is just misunderstanding of one of the central .NET concepts and the question is just invalid.
—SA
Nathan Minier 8-Sep-14 10:36am    
Of course VS uses metadata. In this specific case, it's the metadata that tracks the parameters and return values in a circumstance where uncompiled code is not available, so that intellisense can work and the compiler can check for syntax errors.

It's metadata that VS uses to perform as an IDE, ergo it's VS metadata. Maybe I shouldn't have capitalized the 'M' to avoid confusion.

The specific thing the user is talking about is:
http://msdn.microsoft.com/en-us/library/ms236403.aspx
Sergey Alexandrovich Kryukov 9-Sep-14 12:37pm    
Of course CS uses metadata, how else? I just say, "there is no such thing as Visual Studio metadata". It's the CLI metadata, in particular, the metadata of the code created by the VS user. Didn't you notice that I answered the question already, in exactly the same sense?

Your link is very useful, by the way. You can add another answer and put it, with proper comments.

—SA

1 solution

In what you have observed, there was no such thing as "metadata classes". (Such concept does exist, but this is not what you have been looking at.) You faced completely different thing: you tried to see the declaration of .NET types without having the source code. The source code is simply not available. It was compiled somewhere, and you got only the PE files (class libraries, applications, whatever you got from the 3rd party). Even if the source code exists somewhere on your computer, it is not included in your solution and is not accessible to you. What you see is the code generated from the metadata which is always present in the .NET assembles. Such metadata is one of the central concepts of .NET and CLR.

For understanding of .NET metadata, please see:
http://msdn.microsoft.com/en-us/library/xcd8txaw%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/8dkk3ek4%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900