.NET 是一种用于构建多种应用的免费开源开发平台,例如:

  1. Web 应用、Web API 和微服务
  2. 云中的无服务器函数
  3. 云原生应用
  4. 移动应用
  5. 桌面应用
    1). Windows WPF
    2). Windows 窗体
    3). 通用 Windows 平台 (UWP)
  6. 游戏
  7. 物联网 (IoT)
  8. 机器学习
  9. 控制台应用
  10. Windows 服务

可以为许多操作系统创建 .NET 应用,包括:

  • Windows
  • macOS
  • Linux
  • Android
  • iOS
  • tvOS
  • watchOS

支持的处理器体系结构包括:

  • X64
  • x86
  • ARM32
  • ARM64

.NET 是开放源代码,使用 MIT 和 Apache 2 许可证。 .NET 是 .NET Foundation 的项目。

有关详细信息,请参阅GitHub.com 上的项目存储库列表文档

下载安装.NET5之后,在命令行中运行以下命令

  1. dotnet

如果安装成功,你会看到以下的输出

  1. Usage: dotnet [options]
  2. Usage: dotnet [path-to-application]
  3. Options:
  4. -h|--help Display help.
  5. --info Display .NET information.
  6. --list-sdks Display the installed SDKs.
  7. --list-runtimes Display the installed runtimes.
  8. path-to-application:
  9. The path to an application .dll file to execute.

然后再运行以下命令

  1. dotnet new -l

你会看到以下输出

  1. Templates Short Name Language Tags
  2. -------------------------------------------- ------------------- ------------ -------------------------------
  3. Console Application console [C#], F#, VB Common/Console
  4. Class library classlib [C#], F#, VB Common/Library
  5. WPF Application wpf [C#] Common/WPF
  6. WPF Class library wpflib [C#] Common/WPF
  7. WPF Custom Control Library wpfcustomcontrollib [C#] Common/WPF
  8. WPF User Control Library wpfusercontrollib [C#] Common/WPF
  9. Windows Forms (WinForms) Application winforms [C#] Common/WinForms
  10. Windows Forms (WinForms) Class library winformslib [C#] Common/WinForms
  11. Worker Service worker [C#], F# Common/Worker/Web
  12. Unit Test Project mstest [C#], F#, VB Test/MSTest
  13. NUnit 3 Test Project nunit [C#], F#, VB Test/NUnit
  14. NUnit 3 Test Item nunit-test [C#], F#, VB Test/NUnit
  15. xUnit Test Project xunit [C#], F#, VB Test/xUnit
  16. Razor Component razorcomponent [C#] Web/ASP.NET
  17. Razor Page page [C#] Web/ASP.NET
  18. MVC ViewImports viewimports [C#] Web/ASP.NET
  19. MVC ViewStart viewstart [C#] Web/ASP.NET
  20. Blazor Server App blazorserver [C#] Web/Blazor
  21. Blazor WebAssembly App blazorwasm [C#] Web/Blazor/WebAssembly
  22. ASP.NET Core Empty web [C#], F# Web/Empty
  23. ASP.NET Core Web App (Model-View-Controller) mvc [C#], F# Web/MVC
  24. ASP.NET Core Web App webapp [C#] Web/MVC/Razor Pages
  25. ASP.NET Core with Angular angular [C#] Web/MVC/SPA
  26. ASP.NET Core with React.js react [C#] Web/MVC/SPA
  27. ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA
  28. Razor Class Library razorclasslib [C#] Web/Razor/Library
  29. ASP.NET Core Web API webapi [C#], F# Web/WebAPI
  30. ASP.NET Core gRPC Service grpc [C#] Web/gRPC
  31. dotnet gitignore file gitignore Config
  32. global.json file globaljson Config
  33. NuGet Config nugetconfig Config
  34. Dotnet local tool manifest file tool-manifest Config
  35. Web Config webconfig Config
  36. Solution File sln Solution
  37. Protocol Buffer File proto Web/gRPC

我们可以看到可用的 SPA 模板只支持 angular 和 react

  1. Templates Short Name Language Tags
  2. -------------------------------------------- ------------------- ------------ -------------------------------
  3. ASP.NET Core with Angular angular [C#] Web/MVC/SPA
  4. ASP.NET Core with React.js react [C#] Web/MVC/SPA
  5. ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA

我在 GitHub 上创建了一个项目dotnet-vue,相关的包已经发布到 nuget.org,只需要执行以下命令即可创建一个基于 Vuejs 的 SPA 项目。

项目基于以下技术构建,请先下载安装

安装DotnetVue包

  1. dotnet new --install DotnetVue::1.2.0

然后再运行以下命令

  1. dotnet new -l

你会看到以下输出

  1. Templates Short Name Language Tags
  2. -------------------------------------------- ------------------- ------------ -------------------------------
  3. ASP.NET Core with Vue vue [C#] Web/WebAPI/SPA/Vue

创建新项目

  1. dotnet new vue -o Lemon.Blog.Web

然后执行运行命令

  1. cd Lemon.Blog.Web
  2. dotnet run

在浏览器上访问地址http://localhost:5000/,效果如下

我在 GitHub 上创建了一个项目dotnet-element-admin,相关的包已经发布到 nuget.org,只需要执行以下命令即可创建一个基于 Vuejs 的 SPA 项目。

安装DotnetElementAdmin包

  1. dotnet new --install DotnetElementAdmin::1.0.2

然后再运行以下命令

  1. dotnet new -l

你会看到以下输出

  1. Templates Short Name Language Tags
  2. -------------------------------------------- ------------------- ------------ -------------------------------
  3. ASP.NET Core with ElementAdmin element-admin [C#] Web/WebAPI/SPA/Vue/ElementAdmin

创建新项目

  1. dotnet new element-admin -o Lemon.BlogAdmin.Web

然后执行运行命令

  1. cd Lemon.BlogAdmin.Web
  2. dotnet run

在浏览器上访问地址http://localhost:5000/,效果如下



版权声明:本文为229015504原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/229015504/p/14239375.html