亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

[譯]Introducing ASP.NET vNext and MVC 6

2019-11-17 01:33:49
字體:
來源:轉載
供稿:網友

[譯]Introducing asp.net vNext and MVC 6

原文:http://www.infoq.com/news/2014/05/ASP.NET-vNext?utm_source=tuicool

  Part of the ASP.NET vNext initiative, ASP.NET MVC 6 rePResents a fundamental change to how Microsoft constructs and deploys web frameworks. The goal is to create a host agnostic framework that eliminates the dependencies on the legacy System.Web infrastructure.

  ASP.NET MVC 6作為ASP.NET vNext解決方案的一部分,體現了一個根本性的改變——微軟如何構建和部署web應用。它的目標是:創建一個宿主無關的框架,以便消除對傳統的System.Web程序集的依賴。

  Microsoft feels that System.Web needs to be removed because it is actually quite expensive. A typical HttpContext object graph can consume 30K of memory per request. When working with small JSON-style requests this represents a disproportionately high cost. With MVC 6 new design, the pre-request overhead drops to roughly 2K.

  微軟認為System.Web需要被移除,因為它在實際使用中相當昂貴。在每次請求中,一個典型的HttpContext對象圖會占用30K內存。這與使用JSON通信相比,造成不成比例的高成本。MVC 6力求將“預請求”的開銷下降到大約2K。

  Included in MVC 6 is Web API and Web Pages, allowing Microsoft to remove a lot of the overlap between the three frameworks. One result of this change means that MVC will be self-hosting just like Web API 2 and SignalR 2.

  MVC6中包含Web API,Web Pages,微軟移除了框架中重復的部分,這種變化意味著MVC 6將是自托管的,如同Web API 2和SignalR 2。

  In order to make deployment easier and more reliable, “vNext will support true side-by-side deployment.” Rather than being installed in the GAC, each MVC library needed for a given web site will be referenced like a normal developer-created DLL. “That means you can update your app without affecting other applications on the same server.”

  為了使部署更容易和可靠,vNext將支持真正的并行部署。使用MVC 6構建網站時,站點依賴的程序集不會安裝在GAC中而是和開發者創建的DLL類似。這意味著你可以更新你的應用,而不會影響同一服務器上的其他應用。

Pay As You Go (現收現付)

  MVC 6 is built on a “pay as you go” philosophy. Each feature that you wish to use has to be explicitly turned on in the application startup routine. Even serving up static files requires calling IBuilder.UseStaticFiles.

  MVC 6的設計體現了“現收現付”理念。你希望使用的每一個功能都會在應用啟動程序中開啟。甚至提供靜態文件需要調IBuilder.UseStaticFiles。

  The way this works is that each website needs to have a class named Startup and this class must have a method called “void Configure (IBuilder app)”. Inside this method you can call functions such as “app.UseServices” to enable features such as MVC.

  其工作原理是:每個站點都需要有一個名為Startup的類,這個類有一個方法“void Configure (IBuilder app)”方法。在該方法中可以調用你需要的功能方法,如“app.UseServices”,以便啟動某些特性如MVC。

  Routing is also setup in the Configuration method. MVC 6 routes are similar, but not identical, to MVC 5 routes. For example, a question mark can be added to a fragment to make it optional in MVC 6. In MVC 5 you would use the UrlParameter.Optional value for the same effect.

  路由也在配置方法中進行設置。 與MVC 5的路由相比,MVC 6有些相似,但不完全相同。例如,在MVC 6中可以通過追加問號表示可選參數,而在MVC 5中,需要將其默認值定義為UrlParameter.Optional來達到相同的效果。

Azure and PowerShell Based Deployments (Azure部署和基于PowerShell的部署)

  Microsoft is still heavily pushing Azure as the standard way to deploy websites. But they have realized that developers are leery of publishing websites directly from Visual Studio. So instead they will generate PowerShell deployment scripts by default. These can then be edited inside Visual Studio, which now has basic tooling support for PowerShell.

  微軟仍在很大程度上推動讓Azure部署成為網站部署的標準方式。但他們已經意識到,開發者們都不愿意直接從Visual Studio發布網站。所以,作為替代,默認情況下會生成PowerShell腳本。在新版Visual Studio中,已經包含了一些PowerShell的基本工具,以便用戶能夠在Visual Studio里編輯那些生成的腳本。

The Build Process Doesn’t Build (在生成過程中不會構建程序集)

  In ASP.NET vNext the build process does not actually build anything. No binaries are generated, it merely runs the type checker to ensure you don’t have any errors or warnings that need to be addressed. Instead the code is compiled on the fly in an as-needed basis, much like we already see with ASP.NET Web Pages. This allows for faster iterations, especially over large websites.

  實際上,ASP.NET vNext在生成過程中并沒有構建任何東西。不生成任何二進制文件,它只是運行類型檢查,以發現你代碼的編譯時錯誤和警告。作為代替,代碼會在其被需要時,快速地被編譯,這種按需編譯代碼的方式,很像我們所熟知的ASP.NET中的動態編譯機制。這允許更快的迭代,尤其是在大型網站中。

  If you want actual binaries to be deployed on a server you need to run the package and publish command. Eventually this will offer several options from source code only, which will continue to compile on the fly, all the way up to natively compiled. The latter should have better performance, but could entail a much longer build process.

  如果你想將二進制的程序集部署在服務器上,需要使用發布功能。這種方式將有更好的表現,但也意味著更長的構建時間。

Many APIs Will Be Moved or Removed (一些API將被移動和刪除)

  As mentioned before, they are reducing the size of HttpContext from roughly 30K per request to 2K per request. This isn’t free, the cost of that is a significantly reduced set of methods on that object and its children. And by the time they are done it is probably not going to be the only API trimmed down in size.

  正如前面提到的,既減少HttpContext的大小從大約每個請求30K到2K。這不是免費得來的,其代價是減少該對象及其子對象中的方法。當他們完成時,可能改變的不僅僅是大小。

  In order to make this transition less painful, they intend to develop an FxCop like tool that will detect when legacy APIs calls are being made. While it won’t be able to automatically rewrite your code, it can at least tell you what needs to be changed before migrating to ASP.NET vNext and MVC 6.

  為了使技術過渡更為平滑,微軟打算開發一個類似FxCop的工具,用于檢測遺留的API調用。雖然它不能自動重寫你的代碼,它至少可以告訴你需要遷移到ASP.NET vNext和MVC 6前要改變什么。

  Sometimes the change will just involve calling a different method from an optional package or library. Other times the code will need to be significantly rewritten. Since the product is still in alpha a complete list of these changes is not yet available.

  有時,變化僅僅是調用新的程序集或包中的方法。而其它時候,代碼可能需要大量重構。由于該產品仍然處于alpha階段,這些變化的具體內容尚不可知。

Full Framework vs Cloud Optimized Framework (完整的Framework VS 云優化的Framework)

  The above warnings come into play because they are removing their dependency on System.Web but otherwise stay on the full .NET Framework. If you take the next step and go with what they are calling the “Cloud Optimized Framework” then you lose access to even more APIs. In the Channel 9 Q&A session they mentioned System.Drawing as an example of what you can’t use.

  上述警告開始發揮作用,即使消除對System.Web的依賴,但仍然保持著對.NET Framework的依賴。如果你采取更進一步的行動,依賴“云優化的Framework”,那么,你將無法使用很多.NET Framework的API方法,例如在Channel 9 Q&A session中提到的System.Drawing。

  The advantage of using the Cloud Optimized Framework is that you can include a copy of the Core (or Mono) CLR with your website. You no longer have to upgrade .NET on the entire machine for the sake of one website. You can even have different versions of the CLR for different websites running side by side.

  利用云優化的Framework的好處是,你的站點可以包括Core CLR或Mono的副本。你不必再為某個網站而升級設備軟件,你甚至可以有不同版本的CLR并行地運行不同的站點。

  The Core CLR is also supposed to be tuned with a “high resource-efficient optimization”. Exactly what that means has not yet been revealed.

  Core CLR也應該被“資源優化”過。但具體內容,尚未透露。

Libraries vs Packages (庫 vs 包)

  Under the .NET vNext model, projects don’t reference individual libraries anymore. Instead they reference NuGet Packages. As you probably know, packages can contain multiple versions of a library divided by target platform. ASP.NET vNext can leverage this to decide at runtime whether to load the Full .NET, Mono, or Core CLR version of a given library.

  在vNext中,項目不引用單個類庫,而是引用NuGet包。正如你可能知道的,包可以包含同一類庫的多個版本。ASP.NET vNext可以利用這個來決定在運行時是否加載某個類庫的Full .NET、Mono或Core CLR版本。

  If this doesn’t sound palatable to you, there will also the option to use Portable Class Libraries. Though it isn’t ready yet, they plan on creating a PCL profile for the Cloud Optimized Framework.

  如果這聽起來不吸引你,你也可以使用“可移植類庫”。盡管它還沒有準備好,微軟計劃為云優

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
欧美激情免费观看| 美女精品久久久| 国产va免费精品高清在线| 日韩精品免费在线| 国产在线拍揄自揄视频不卡99| 国产在线999| 欧美日韩精品在线视频| 欧美一级bbbbb性bbbb喷潮片| 7m第一福利500精品视频| 欧美日韩一区免费| 国产区精品视频| 国产在线一区二区三区| 久久久久久久久久国产| 欧美午夜丰满在线18影院| 这里精品视频免费| 91国在线精品国内播放| 国产精品www| 日本亚洲欧洲色α| 欧美乱妇40p| 91日本视频在线| 欧美华人在线视频| 亚洲人成在线观看| 久久av资源网站| 国产精品亚洲欧美导航| 91热精品视频| 亚洲国语精品自产拍在线观看| 久久精品国产96久久久香蕉| 亚洲欧美在线第一页| 精品国产一区二区三区久久狼黑人| 成人做爽爽免费视频| 亚洲男人天堂视频| 夜夜嗨av色一区二区不卡| 日韩一区二区三区在线播放| 日韩电影中文字幕| 午夜精品久久久久久久99黑人| 97视频在线看| 成人福利视频网| 国产精品久久视频| 亚洲第一av在线| 国产精品偷伦一区二区| 亚洲最大福利视频网站| 国产拍精品一二三| 亚洲毛片在线免费观看| 欧美另类暴力丝袜| 久久精品小视频| 精品亚洲国产视频| 国产亚洲精品美女久久久| 欧美高清视频在线| 午夜精品一区二区三区在线视| 日韩欧美精品中文字幕| 亚洲福利视频二区| 国产精品久久久久高潮| 欧美日韩久久久久| 97在线免费观看| 97精品视频在线| 国产精品一区专区欧美日韩| 欧美在线亚洲在线| 中文字幕亚洲综合| 亚洲欧洲一区二区三区在线观看| 久久久久久久久久久网站| 国产精品入口尤物| 国产精品情侣自拍| 亚洲国产高清高潮精品美女| 在线免费观看羞羞视频一区二区| 亚洲色在线视频| 国产一区二区三区在线视频| 亚洲人成亚洲人成在线观看| 亚洲桃花岛网站| 日韩av片免费在线观看| 亚洲人成自拍网站| 欧美激情视频给我| 亚洲一区二区久久久久久| 亚洲一区二区久久久| 欧美一级片一区| 久久久久久久久久国产| 亚洲精选一区二区| 欧美性xxxx在线播放| 久久国产精品偷| 国产精品白丝av嫩草影院| 欧美一区二区色| 亚洲国产古装精品网站| 欧美激情在线狂野欧美精品| 欧美一级bbbbb性bbbb喷潮片| 一二美女精品欧洲| 亚洲3p在线观看| 51精品在线观看| 亚洲四色影视在线观看| 91在线高清免费观看| 成人欧美一区二区三区黑人孕妇| 日韩中文字幕在线视频播放| 亚洲午夜精品久久久久久久久久久久| 热re99久久精品国产66热| 亚洲国产精品女人久久久| 欧美日韩成人黄色| 亚洲人成网站999久久久综合| 国产成人欧美在线观看| 国产成人亚洲综合91精品| 欧美乱人伦中文字幕在线| 亚洲人成电影在线| 久热精品视频在线| 韩日精品中文字幕| 黄色91在线观看| 欧美理论片在线观看| 日韩av在线看| 亚洲国产日韩欧美在线99| 国产三级精品网站| 青青青国产精品一区二区| 51ⅴ精品国产91久久久久久| 91成人在线观看国产| www国产精品com| 亚洲国产精品大全| 亚洲一区中文字幕| 日韩av在线看| 亚洲激情在线视频| 欧美日韩亚洲成人| 日日摸夜夜添一区| 欧美大肥婆大肥bbbbb| 亚洲国产91色在线| 亚洲精品久久久久中文字幕二区| 91在线精品视频| 热久久这里只有精品| 国产主播欧美精品| 中文字幕精品www乱入免费视频| 欧美高清激情视频| 91精品国产综合久久久久久久久| 国产亚洲综合久久| 九色精品免费永久在线| 超在线视频97| 国产丝袜一区二区三区免费视频| 国产精品入口日韩视频大尺度| 久久97久久97精品免视看| 国产精品永久免费视频| 国产91在线播放精品91| 国产精品久久av| 欧美一区二区影院| 亚洲美女福利视频网站| 亚洲美女动态图120秒| 成人欧美一区二区三区在线| 成人黄色片在线| 中文字幕少妇一区二区三区| 7777精品久久久久久| 日韩一区二区福利| 2019中文字幕在线观看| 亚洲欧美激情一区| 91禁外国网站| 日韩福利伦理影院免费| 一本色道久久88亚洲综合88| 国产成人久久精品| 亚洲色图综合久久| 91美女片黄在线观| 日韩电影免费观看在线| 亚洲视频在线观看网站| 亚洲一区二区三区四区在线播放| 亚洲视频在线免费看| 色婷婷亚洲mv天堂mv在影片| 欧美日韩国产丝袜美女| 米奇精品一区二区三区在线观看| 久久在精品线影院精品国产| 综合av色偷偷网| 欧美视频一区二区三区…| 在线a欧美视频| 欧美性受xxxx白人性爽| 久久国产精彩视频| 亚洲欧美日韩精品久久奇米色影视|