TJFrags
❔ Update-Database causing error
Hi, When I try to use the "Update-Database" command in visual studio an error occures:
An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Failed to load configuration from file 'C:\Users\Pc\source\repos\GamersRisingWeb\GamersRising\appsettings.json'.
Unable to create an object of type 'ApplicationDbContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
This started after changing a migration file but now I still get the error after changing it back. Is there a way to fix this without restarting?
25 replies
❔ Database not being created
Hi, Im following this tutorial: https://www.youtube.com/watch?v=ogJTM1l2fl0&t=731s. In the video an sql server is started using SSMS, then the servers name is put into "appsettingss.json"
server name = Revision-PC
"DefaultConnection": "Server=(localdb)\mssqllocaldb;Database=Revision-PC;Trusted_Connection=True;MultipleActiveResultSets=true"
My problem comes up when i try update-database command. The database is not created in SSMS. .NET 5 is used in the tutorial, could that be the issue?or am i missing somethimg.
2 replies