步驟1:確保生成輸出生成在生成選項中檢查選項。 (只有在選中該選項時,纔會生成DLL
文件。)
步驟2:在版本模式下構建Web應用程序。
第3步:編譯的DLLs
將出現在:..\artifacts\bin\WebAppName\Release\dnx451
。
第4步:生成的DLLs
可以使用ILSpy進行檢查。
第5步:選擇Web應用程序並點擊發佈。
步驟6:轉到已發佈的路徑:..\approot\src\WebAppName
並刪除編譯爲DLLs
(驗證步驟4之後)的所有Class
文件。如果使用ViewModels
,則不應刪除這些文件,因爲它們將用於Views
(請參閱步驟8)。
第7步:複製步驟3中生成的DLLs
,並粘貼發佈的路徑:..\approot\src\WebAppName
。
第8步:將所有ViewModel
文件移動到Views
文件夾中。
第9步:在地點:..\approot\src\WebAppName
打開Command Window
。
步驟10:在命令窗口中鍵入dnx --lib "..\approot\src\WebAppName" web
,然後單擊Enter
。 (進入其中Command Window
被打開的路徑。)
第11步:現在,Kestrel Server
是了,你可以通過訪問瀏覽Web應用程序http://localhost:5000/
注: DNX是贊成的是retired新的.NET Core Command LIne (CLI) Tools。
提示1:要查看來自移動設備的應用程序,請檢查:Viewing localhost website from mobile device。