I have a simple Web API using .net Entity Framework Core 2.2. Everything works in debug mode in Visual Studio. But when I build and run it, it fails to connect to the database.
The error massage :
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HLRCVL1R3B1L", Request id "0HLRCVL1R3B1L:00000001": An unhandled exception was thrown by the application.
System.ArgumentNullException: Value cannot be null.
Parameter name: connectionStringat Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName)
at Microsoft.EntityFrameworkCore.SqlServerDbContextOptionsExtensions.UseSqlServer(DbContextOptionsBuilder optionsBuilder, String connectionString, Action`1 sqlServerOptionsAction)
at TSPfizer.CentoMiner.Web.Startup.b__4_1(DbContextOptionsBuilder options) in C:\Users\shangl02\source\repos\TSolution\CentoMinerWebAPI\Startup.cs:line 43
Did I miss something there?