• Najnowsze pytania
  • Bez odpowiedzi
  • Zadaj pytanie
  • Kategorie
  • Tagi
  • Zdobyte punkty
  • Ekipa ninja
  • IRC
  • FAQ
  • Regulamin
  • Książki warte uwagi

Błąd przy wyświetlaniu strony asp .net core An error occurred while processing your request

Cloud VPS
0 głosów
354 wizyt
pytanie zadane 6 sierpnia 2017 w C# przez mus Użytkownik (700 p.)

Witam na potkałem pewien problem podczas uruchamiania stworzen strony w asp .net core

An error occurred while processing your request.
Development Mode

Swapping to Development environment will display more detailed information about the error that occurred.

Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 

Poniżej podaje pliki z kodem

Web config

<configuration>

  <!--
  Configure your application settings in appsettings.json. Learn more at https://go.microsoft.com/fwlink/?LinkId=786380

  <appSettings>
      appSettings in web.config is no longer used in ASP.NET Core, instead use appsettings.json
  </appSettings>
  -->

  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
  <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      </environmentVariables>
</configuration>

HomeController

public IActionResult CreateConferences()
        {
            var conference = new Conference(){
                Name ="firdty",
                TicketPrice = 12
            };
            ctx.Conferences.Add(conference);
            ctx.SaveChanges();

            var sessionsTitles = new List<string>{
                ".net core", " asp net core", "entity framework core"
            };
            foreach(var title1 in sessionsTitles){
                var session = new Sessio(){
                    Title = title1,
                    Conference = conference
                };
                ctx.Sessions.Add(session);
                ctx.SaveChanges();
            }
            return RedirectToAction("Conference");
        }

        public IActionResult Conference(){
            
            var conference = ctx.Conferences.First();
            return View(conference);
        }

Widok

@model new.Models.Conference

@{
    ViewData["Title"] = "Conference";
}
<h2>@Model.Name</h2>

 

Zaloguj lub zarejestruj się, aby odpowiedzieć na to pytanie.

Podobne pytania

0 głosów
0 odpowiedzi 414 wizyt
pytanie zadane 22 czerwca 2021 w C# przez niezalogowany
0 głosów
1 odpowiedź 731 wizyt
pytanie zadane 17 listopada 2021 w C# przez kuba412 Początkujący (310 p.)
0 głosów
1 odpowiedź 333 wizyt
pytanie zadane 2 marca 2020 w C# przez Moras Obywatel (1,620 p.)

93,487 zapytań

142,420 odpowiedzi

322,772 komentarzy

62,904 pasjonatów

Motyw:

Akcja Pajacyk

Pajacyk od wielu lat dożywia dzieci. Pomóż klikając w zielony brzuszek na stronie. Dziękujemy! ♡

Oto polecana książka warta uwagi.
Pełną listę książek znajdziesz tutaj

Kursy INF.02 i INF.03
...