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>