![]() ![]() Production apps should not be run in development mode because the developer exception page can leak sensitive information. 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. The default browser launched with the following URL: where is the randomly generated port number.įor Visual Studio for Mac, see the. 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. The code command opens the RazorPagesMovie folder in the current instance of Visual Studio Code.įor Visual Studio for Mac, see the. The dotnet new command creates a new Razor Pages project in the RazorPagesMovie folder. Yes, I trust the authors (because dotnet generated the files).The checkbox trust the authors of all files in the parent folder. ![]() Visual Studio Code displays a dialog box that asks Do you trust the authors of the files in this folder. Run the following commands: dotnet new webapp -o RazorPagesMovie Select New Terminal from the Terminal menu to open the integrated terminal.Ĭhange to the directory ( cd) that will contain the project. The following starter project is created:įor alternative approaches to create the project, see Create a new project in Visual Studio. Verify: Do not use top-level statements is unchecked.It's important to name the project RazorPagesMovie, including matching the capitalization, so the namespaces will match when you copy and paste example code. ![]() In the Configure your new project dialog, enter RazorPagesMovie for Project name. In the Create a new project dialog, select ASP.NET Core Web App > Next. Start Visual Studio and select New project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |