ASP.NET MVC 6 和 ASP.NET Core 1.0 之间有什么区别以及核心框架背后的原因?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38109524/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 09:49:32  来源:igfitidea点击:

What is the difference between ASP.NET MVC 6 and ASP.NET Core 1.0 and the reason behind the core framework?

.netasp.net-mvcasp.net-core-mvc

提问by V.Sriram

I understand that ASP.NET Core is a modular framework which unites technologies like ASP.NET MVC and Web API into a single programming model.

我知道 ASP.NET Core 是一个模块化框架,它将 ASP.NET MVC 和 Web API 等技术整合到一个单一的编程模型中。

But one of the features of ASP.NET MVC 6 was introducing the merging of MVC 6 and Web API together along with following features. Dependency injection is inbuilt and part of MVC.

但是 ASP.NET MVC 6 的功能之一是引入了 MVC 6 和 Web API 的合并以及以下功能。依赖注入是内置的,是 MVC 的一部分。

1) Side by side - deploy the runtime and framework with your application

1) 并排 - 将运行时和框架与您的应用程序一起部署

2) Everything packaged with NuGet, Including the .NET runtime itself.

2) NuGet 打包的所有内容,包括 .NET 运行时本身。

3) New JSON based project structure.

3) 新的基于 JSON 的项目结构。

4) No need to recompile for every change. Just hit save and refresh the browser.

4) 无需为每次更改重新编译。只需点击保存并刷新浏览器。

5) Compilation done with the new Roslyn real-time compiler.

5) 使用新的 Roslyn 实时编译器完成编译。

So why there are 2 standalone ASP.NET frameworks? since core framework has been in existence, will MVC 6 not be used hereafter?

那么为什么有 2 个独立的 ASP.NET 框架呢?既然核心框架已经存在,以后会不会不使用MVC 6?

would be great if someone can clarify.

如果有人可以澄清会很棒。

采纳答案by gnllucena

MVC 6 was part of ASP.NET 5, but due to some major changes in the code base, they decided to change its name from ASP.NET 5 to ASP.NET Core.

MVC 6 是 ASP.NET 5 的一部分,但由于代码库中的一些重大更改,他们决定将其名称从 ASP.NET 5 更改为 ASP.NET Core。

You can read about here: http://www.hanselman.com/blog/ASPNET5IsDeadIntroducingASPNETCore10AndNETCore10.aspx

您可以在这里阅读:http: //www.hanselman.com/blog/ASPNET5IsDeadIntroducingASPNETCore10AndNETCore10.aspx

回答by Mark Macneil Bikeio

The main difference between ASP.NETand ASP.NET Coreare as described below...

ASP.NET和之间的主要区别ASP.NET Core如下所述...

  • Platform Independent Features ASP.NET Coreprovides hosting in multiple platform like Linux or Mac or Windows hosting (Cross platform).
  • Introduced new lighter version of assemblies with non dependent frameworks.
  • Ready for cross platform cloud hosting.
  • Frameworks are a complete rewrite (and still building)
  • Project default project structure got renewed with type scripts configurations.
  • Improved new security features and dependency inversions.
  • 平台独立功能ASP.NET Core提供多平台托管,如 Linux 或 Mac 或 Windows 托管(跨平台)。
  • 引入了具有非依赖框架的新的较轻版本的程序集。
  • 准备跨平台云托管。
  • 框架是完全重写(并且仍在构建)
  • 使用类型脚本配置更新了项目默认项目结构。
  • 改进了新的安全功能和依赖倒置。

Please visit .NET Coreand ASP.NET Corefor more details

请访问.NET CoreASP.NET Core了解更多详情

The main reason behind the core framework is dependency inversion. As its framework is completely rewritten in such a way that high level assemblies completelydecoupledfrom low level supporting assemblies.

核心框架背后的主要原因是依赖倒置。由于它的框架被完全重写,高级程序集低级支持程序集完全分离

回答by Liakat

As I can see your question has two part. First part is more technical which was well explained on other answers I think, so let me try to explain second part which is reason behind new .net core framework.

我可以看到你的问题有两个部分。第一部分更具技术性,我认为在其他答案中得到了很好的解释,所以让我尝试解释第二部分,这是新的 .net 核心框架背后的原因。

Most of web application runs in Linux and most of website is build with open source languages such as php, python, ruby. Also you will notice some most popular CMS application like WordPress built with php which is more preferable to host in Linux obviously. In other hand Microsoft is well known for commercial paid software and closed source ofcourse. In technology world Microsoft was missing trust from open source lovers due to its own closed source type of design. So finally they also wants to take market share from open source community. And there was no other way then rebuild .net core under open source type of design. Also beside all of these Microsoft trying to show love for open source community to build trust as a part of that they has acquired github which is most popular tool for open source developer community. So basically Microsoft trying extend its business being involved in open source software world and .net core is most important to attract developers. This is the key reason I think behind the core framework.

大多数 web 应用程序在 Linux 上运行,大多数网站是用开源语言构建的,如 php、python、ruby。此外,您还会注意到一些最流行的 CMS 应用程序,例如使用 php 构建的 WordPress,这显然更适合在 Linux 中托管。另一方面,微软以商业付费软件和闭源软件而闻名。在技​​术世界中,由于其自​​己的封闭源代码类型的设计,微软失去了开源爱好者的信任。所以最后他们也想从开源社区抢夺市场份额。没有其他办法,然后在开源设计类型下重建 .net core。除了所有这些,微软还试图表达对开源社区的热爱以建立信任,作为他们收购开源开发者社区最受欢迎的工具 github 的一部分。所以基本上微软试图扩展其业务涉足开源软件世界,而.net core对于吸引开发者来说是最重要的。这是我认为核心框架背后的关键原因。