mvc 4中的元数据类是如何创建的? [英] Where the metadata classes in mvc 4 are created and how?

查看:50
本文介绍了mvc 4中的元数据类是如何创建的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在互联网上找到了示例代码。它使用的是很少的API,它们在mvc 4中不是默认的。当我点击转到定义时,它显示了一些帮助类[来自元数据]。当我找到这个类时,它位于AppData-> Temp中。我想问一下,如何生成类,如果我创建一个新项目,我该如何创建它。

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.

推荐答案

在你所观察到的,没有这样的作为元数据类的东西。 (这样的概念确实存在,但这不是你一直在看的。)你遇到了完全不同的事情:你试图在没有源代码的情况下看到.NET类型的声明。源代码根本不可用。它是在某处编译的,你只得到了PE文件(类库,应用程序,无论你从第三方得到什么)。即使源代码存在于您的计算机上某个位置,它也不会包含在您的解决方案中,并且您无法访问。您看到的是从元数据生成的代码,它始终存在于.NET程序集中。这样的元数据是.NET和CLR的核心概念之一。



有关.NET元数据的理解,请参阅:

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
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


这篇关于mvc 4中的元数据类是如何创建的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆