简体   繁体   English

ASP.NET MVC 4项目的DBML文件

[英]DBML files for ASP.NET MVC 4 project

I am working on a MVC 4 project and I was curious as to how the DBML files are protected. 我正在从事MVC 4项目,并且对如何保护DBML文件感到好奇。 After all, the dbml file is a xml file that is a description of the Database structure.What prevents the user from downloading the DBML file? 毕竟,dbml文件是一个XML文件,是对数据库结构的描述。什么阻止了用户下载DBML文件?

What prevents people from downloading the .dbml file is that it shouldn't be part of a properly built and published .NET project. 阻止人们下载.dbml文件的原因在于,该文件不应属于正确构建和发布的.NET项目。 When you compile and deploy your project, you will notice that all of those .cs files you had are gone. 在编译和部署项目时,您会注意到所有的.cs文件都已消失。 They were compiled into a .dll that the application actually runs. 它们被编译为应用程序实际运行的.dll Same with the .dbml file. .dbml文件相同。 All of your .dll files end up in the bin folder, which is a restricted (read - cannot access) folder within a .NET application running under IIS. 您所有的.dll文件最终都位于bin文件夹中,该文件夹是在IIS下运行的.NET应用程序中的受限制(无法访问)文件夹。

In short, never, ever build and copy your entire project to a web facing directory. 简而言之,永远不要将整个项目构建并复制到面向Web的目录中。 Use the built in publishing methods to properly deploy your application/web site. 使用内置的发布方法正确部署您的应用程序/网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM