2. 创建一个基于ASP.NET Core Web App模板的web应用
5. 本地使用麒麟自带的火狐浏览器访问 http://localhost:5000
.NET Core3.1安装参考:
银河麒麟高级服务器操作系统V10上安装.NET Core3.1
指令如下:
- $ dotnet --info
- .-property">NET Core -variable constant_">SDK (reflecting any -variable language_">global.-property">json):
- Version: 3.1.402
- Commit: 9b5de826fd
-
- Runtime Environment:
- -variable constant_">OS Name: kylin
- -variable constant_">OS Version: -variable constant_">V10
- -variable constant_">OS Platform: Linux
- RID: linux-arm64
- Base Path: -regexp">/home/greatwall/dotnet/sdk/3.1.402/
-
- Host (useful for support):
- Version: 3.1.8
- Commit: 9c1330dedd
-
- .-property">NET Core SDKs installed:
- 3.1.402 [-regexp">/home/greatwall/dotnet/sdk]
-
- .-property">NET Core runtimes installed:
- Microsoft.-property">AspNetCore.-property">App 3.1.8 [-regexp">/home/greatwall/dotnet/shared/Microsoft.-property">AspNetCore.-property">App]
- Microsoft.-property">NETCore.-property">App 3.1.8 [-regexp">/home/greatwall/dotnet/shared/Microsoft.-property">NETCore.-property">App]
-
- To install additional .-property">NET Core runtimes or SDKs:
- https://aka.ms/dotnet-download
- $ dotnet new -operator">-l
- Usage: new [options]
-
- Options:
- -operator">-h, --help Displays help for this command.
- -operator">-l, --list Lists templates containing the specified name. If no name is specified, lists all templates.
- -operator">-n, --name The name for the output being created. If no name is specified, the name of the current directory is used.
- -operator">-o, --output Location to place the generated output.
- -operator">-i, --install Installs a source or a template pack.
- -operator">-u, --uninstall Uninstalls a source or a template pack.
- --nuget-source Specifies a NuGet source to use during install.
- --type Filters templates based on available types. Predefined values are "project", "item" or "other".
- --dry-run Displays a summary of what would happen if the given command line were run if it would result in a template creation.
- --force Forces content to be generated even if it would change existing files.
- -operator">-lang, --language Filters templates based on language and specifies the language of the template to create.
- --update-check Check the currently installed template packs for updates.
- --update-apply Check the currently installed template packs for update, and install the updates.
-
-
- Templates Short Name Language Tags
- ----------------------------------------------------------------------------------------------------------------------------------
- Console Application console [C], F, VB Common-operator">/Console
- Class library classlib [C], F, VB Common-operator">/Library
- WPF Application wpf [C] Common-operator">/WPF
- WPF Class library wpflib [C] Common-operator">/WPF
- WPF Custom Control Library wpfcustomcontrollib [C] Common-operator">/WPF
- WPF User Control Library wpfusercontrollib [C] Common-operator">/WPF
- Windows Forms (WinForms) Application winforms [C] Common-operator">/WinForms
- Windows Forms (WinForms) Class library winformslib [C] Common-operator">/WinForms
- Worker Service worker [C] Common-operator">/Worker-operator">/Web
- Unit Test Project mstest [C], F, VB Test-operator">/MSTest
- NUnit 3 Test Project nunit [C], F, VB Test-operator">/NUnit
- NUnit 3 Test Item nunit-operator">-test [C], F, VB Test-operator">/NUnit
- xUnit Test Project xunit [C], F, VB Test-operator">/xUnit
- Razor Component razorcomponent [C] Web-operator">/ASP.NET
- Razor Page page [C] Web-operator">/ASP.NET
- MVC ViewImports viewimports [C] Web-operator">/ASP.NET
- MVC ViewStart viewstart [C] Web-operator">/ASP.NET
- Blazor Server App blazorserver [C] Web-operator">/Blazor
- Blazor WebAssembly App blazorwasm [C] Web-operator">/Blazor-operator">/WebAssembly
- ASP.NET Core Empty web [C], F Web-operator">/Empty
- ASP.NET Core Web App (Model-operator">-View-operator">-Controller) mvc [C], F Web-operator">/MVC
- ASP.NET Core Web App webapp [C] Web-operator">/MVC-operator">/Razor Pages
- ASP.NET Core with Angular angular [C] Web-operator">/MVC-operator">/SPA
- ASP.NET Core with React.js react [C] Web-operator">/MVC-operator">/SPA
- ASP.NET Core with React.js and Redux reactredux [C] Web-operator">/MVC-operator">/SPA
- Razor Class Library razorclasslib [C] Web-operator">/Razor-operator">/Library-operator">/Razor Class Library
- ASP.NET Core Web API webapi [C], F Web-operator">/WebAPI
- ASP.NET Core gRPC Service grpc [C] Web-operator">/gRPC
- dotnet gitignore file gitignore Config
- global.json file globaljson Config
- NuGet Config nugetconfig Config
- Dotnet local tool manifest file tool-operator">-manifest Config
- Web Config webconfig Config
- Solution File sln Solution
- Protocol Buffer File proto Web-operator">/gRPC
- $ mkdir code/dotnet -p
- $ cd code/dotnet/
-
指令如下:
- $ dotnet new webapp -o myWebApp --no-https
- The template "ASP.NET Core Web App" was created successfully.
- This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/3.1-third-party-notices for details.
-
- Processing post-creation actions...
- Running 'dotnet restore' on myWebApp/myWebApp.csproj...
- Determining projects to restore...
- Restored /home/greatwall/code/dotnet/myWebApp/myWebApp.csproj (in 398 ms).
-
- Restore succeeded.
- $ cd myWebApp/
- $ find
- .
- ./appsettings.Development.json
- ./appsettings.json
- ./myWebApp.csproj
- ./Program.cs
- ./Startup.cs
- ./Pages
- .-regexp">/Pages/Error.cshtml
- .-regexp">/Pages/Error.cshtml.cs
- .-regexp">/Pages/Index.cshtml
- .-regexp">/Pages/Index.cshtml.cs
- .-regexp">/Pages/Privacy.cshtml
- .-regexp">/Pages/Privacy.cshtml.cs
- .-regexp">/Pages/_ViewImports.cshtml
- .-regexp">/Pages/_ViewStart.cshtml
- .-regexp">/Pages/Shared
- .-regexp">/Pages/Shared/_Layout.cshtml
- .-regexp">/Pages/Shared/_ValidationScriptsPartial.cshtml
- ./Properties
- .-regexp">/Properties/launchSettings.json
- ./wwwroot
- .-regexp">/wwwroot/favicon.ico
- .-regexp">/wwwroot/css
- .-regexp">/wwwroot/css/site.css
- .-regexp">/wwwroot/js
- .-regexp">/wwwroot/js/site.js
- .-regexp">/wwwroot/lib
- .-regexp">/wwwroot/lib/bootstrap
- .-regexp">/wwwroot/lib-regexp">/bootstrap/LICENSE
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist/css
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap-grid.css
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap-grid.css.map
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap-grid.min.css
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap-grid.min.css.map
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap-reboot.css
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap-reboot.css.map
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap-reboot.min.css
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap-reboot.min.css.map
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap.css
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap.css.map
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap.min.css
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/css/bootstrap.min.css.map
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist/js
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/js/bootstrap.bundle.js
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/js/bootstrap.bundle.js.map
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/js/bootstrap.bundle.min.js
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/js/bootstrap.bundle.min.js.map
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/js/bootstrap.js
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/js/bootstrap.js.map
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/js/bootstrap.min.js
- .-regexp">/wwwroot/lib-regexp">/bootstrap/dist-regexp">/js/bootstrap.min.js.map
- .-regexp">/wwwroot/lib/jquery
- .-regexp">/wwwroot/lib-regexp">/jquery/LICENSE.txt
- .-regexp">/wwwroot/lib-regexp">/jquery/dist
- .-regexp">/wwwroot/lib-regexp">/jquery/dist/jquery.js
- .-regexp">/wwwroot/lib-regexp">/jquery/dist/jquery.min.js
- .-regexp">/wwwroot/lib-regexp">/jquery/dist/jquery.min.map
- .-regexp">/wwwroot/lib/jquery-validation
- .-regexp">/wwwroot/lib-regexp">/jquery-validation/LICENSE.md
- .-regexp">/wwwroot/lib-regexp">/jquery-validation/dist
- .-regexp">/wwwroot/lib-regexp">/jquery-validation/dist/additional-methods.js
- .-regexp">/wwwroot/lib-regexp">/jquery-validation/dist/additional-methods.min.js
- .-regexp">/wwwroot/lib-regexp">/jquery-validation/dist/jquery.validate.js
- .-regexp">/wwwroot/lib-regexp">/jquery-validation/dist/jquery.validate.min.js
- .-regexp">/wwwroot/lib/jquery-validation-unobtrusive
- .-regexp">/wwwroot/lib-regexp">/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js
- .-regexp">/wwwroot/lib-regexp">/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js
- .-regexp">/wwwroot/lib-regexp">/jquery-validation-unobtrusive/LICENSE.txt
- ./obj
- .-regexp">/obj/myWebApp.csproj.nuget.g.props
- .-regexp">/obj/myWebApp.csproj.nuget.g.targets
- .-regexp">/obj/project.assets.json
- .-regexp">/obj/project.nuget.cache
- .-regexp">/obj/myWebApp.csproj.nuget.dgspec.json
- -variable">$ dotnet run
- warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
- No XML encryptor configured. Key {ab9f0472-2b78-4463-af8b-ea648e992f0e} may be persisted to storage in unencrypted form.
- info: Microsoft.Hosting.Lifetime[0]
- Now listening on: http:/-regexp">-regexp">/localhost:5000
- -regexp">info: Microsoft.Hosting.Lifetime[0]
- -regexp"> Application started. Press Ctrl+C to shut down.
- -regexp">info: Microsoft.Hosting.Lifetime[0]
- -regexp"> Hosting environment: Development
- -regexp">info: Microsoft.Hosting.Lifetime[0]
- -regexp"> Content root path: /home-regexp">/greatwall/code-regexp">/dotnet/myWebApp
银河麒麟V10上,.NET Core指令操作与Windows平台相同,运行效果没有太大差异
网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。
加入交流群
请使用微信扫一扫!