The developer exception page is enabled by default and provides helpful information on exceptions. The following lines of code in this file create a WebApplicationBuilder with preconfigured defaults, add Razor Pages support to the Dependency Injection (DI) container, and builds the app: var builder = WebApplication.CreateBuilder(args) You may want to change this for production scenarios, see. Program.csĬontains the following code: var builder = WebApplication.CreateBuilder(args) For more information, see Configuration in ASP.NET Core. appsettings.jsonĬontains configuration data, like connection strings. For more information, see Static files in ASP.NET Core. wwwroot folderĬontains static assets, like HTML files, JavaScript files, and CSS files. For more information, see Layout in ASP.NET Core. _Layout.cshtml sets up the navigation menu at the top of the page and the copyright notice at the bottom of the page. For example, the _Layout.cshtml file configures UI elements common to all pages. Supporting files have names that begin with an underscore. cshtml.cs file that has C# code that handles page events. cshtml file that has HTML markup with C# code using Razor syntax. Pages folderĬontains Razor pages and supporting files. The following sections contain an overview of the main project folders and files that you'll work with in later tutorials. Visual Studio for Mac launches a browser and navigates to where is the port number randomly assigned at project creation and is set in Properties/launchSettings.json. Select Debug > Start Debugging to launch the app. The default browser launched with the following URL: where is the randomly generated port number. At the Select environment prompt, select. In Visual Studio Code, press Ctrl+F5 to run the app. See Trust the ASP.NET Core HTTPS development certificate for more information. The preceding command displays the following dialog, provided the certificate was not previously trusted: See your Linux distribution's documentation for trusting a certificate. The preceding command doesn't work on Linux. Trust the HTTPS development certificate by running the following command: dotnet dev-certs https -trust is the random port that is assigned when the app was created. Launches the default browser at which displays the apps UI.Runs the app, which launches the Kestrel server.Select Yes if you agree to trust the development certificate.įor information on trusting the Firefox browser, see Firefox SEC_ERROR_INADEQUATE_KEY_USAGE certificate error. Select Yes if you trust the IIS Express SSL certificate. Visual Studio displays the following dialog when a project is not yet configured to use SSL: Select RazorPagesMovie in Solution Explorer, and then press Ctrl+F5 to run without the debugger. It's important to name the project RazorPagesMovie, including matching the capitalization, so the namespaces will match when you copy and paste example code. Enter RazorPagesMovie for Project name.Verify: Authentication is set to No Authentication. In the Configure your new Web Application dialog:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |