Thursday, August 24, 2017

Microsoft.EntityFrameworkCore.Database.Connection[200004]


 Microsoft.EntityFrameworkCore.Database.Connection[200004]
      An error occurred using the connection to database 'DBAPIContext-4266f07e-a498-4ab6-9c86-792af5b78354' on server '(localdb)\mssqllocaldb'.
System.Data.SqlClient.SqlException (0x80131904): Cannot open database "DBAPIContext-4266f07e-a498-4ab6-9c86-792af5b78354" requested by the login. The login failed.
Login failed for user 'user.ID'.


---------------------------
Microsoft Visual Studio
---------------------------
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. 
Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. 
Specified LocalDB instance name is invalid.

)
---------------------------
OK   

---------------------------



Solution: 

The following 2 steps solved issue for me.

1- One run the following command in command window


2- Then run PM> Update-Database in Package manager in your visual studio project.


 Then you can check the DB by try connecting via Management Studio.


Thursday, August 17, 2017

nuget configuration is invalid.


---------------------------
Microsoft Visual Studio
---------------------------
"Project" nuget configuration is invalid.

---------------------------
OK  
---------------------------

When you try to add the reference, via Manage Nuget Packages. You may get this above error message.

The solution is simple. Close the Visual Studio and open it again. This works most of the time. 

ASP.NET MVC - Sport Facility Booking system

  The project relies on some external service providers. Thus accessing them via their API requires authentication. An API Key need to be su...