Usage: dotnet [options]Usage: dotnet [path-to-application]Options:-h|--help Display help.--info Display .NET information.--list-sdks Display the installed SDKs.--list-runtimes Display the installed runtimes.path-to-application:The path to an application .dll file to execute.
如果一切順利,請選取下方的 [繼續] 按鈕以移至下一個步驟。
發生錯誤嗎?
如果您收到 [無法將 'dotnet' 辨識為內部或外部命令] 錯誤,請確定已開啟新的 VS Code 終端。如果重新啟動 VS Code 或 重新啟動您的機器都無法解決問題,請使用 [我遇到問題] 按鈕以尋求解決問題的協助。
建立您自己的應用程式
按下 CTRL+SHIFT+P,在 VS Code 中開啟命令選擇區。
按下 CMD+SHIFT+P,在 VS Code 中開啟命令選擇區。
輸入 .NET: 以查看您可以使用 C# 開發套件執行的命令!
尋找並選取 [.NET: 新專案] 以建立新的 .NET 專案。
Scroll down and select Blazor Web App.
選擇您要儲存專案的資料夾位置。
Name the project BlazorApp in the command palette when prompted. Press Enter to confirm.
勾選方塊並選取 [是,我信任作者],以啟用 [工作區信任]。
如果您有 Visual Studio 訂閱,請登入您的帳戶。如果您沒有看到提示快顯視窗,請按一下視窗右下方 VS Code 狀態列中的 C# 圖示。
In the Side Bar, make sure the VS Code Explorer is open. Here you will see the BlazorApp folder and the Solution Explorer.Follow along with the video below to: collapse the BlazorApp folder, open the Solution Explorer, open the BlazorApp project, and drag and drop the Solution Explorer higher.
Collapse the BlazorApp folder in the VS Code Explorer.
按一下方案總管左側的箭號即可展開。
Click on the chevron to the left of the BlazorApp project in the Solution Explorer to expand it.
Drag and drop the Solution Explorer below BlazorApp.
Your project is created and loaded in Visual Studio Code. Take a look at the contents of your project using Solution Explorer.
Select the Run and Debug icon in the Activity Bar on the left side of your workspace.
Select the blue Run and Debug button.
Visual Studio Code will open up a menu of launch configurations. Select C#: BlazorApp [Default Configuration].
Then you need to select a debugger. Select C#.
等候應用程式在瀏覽器中啟動。一旦您移至下列頁面,就已成功執行您的第一個 Blazor 應用程式!
You can stop the app at any time by clicking on the stop button in the top toolbar.
To re-run your application, select the dropdown menu to the right of the run button in the top right, and select Run project associated with this file.