I have some issues with the program.cs file, with the version of ASP.NetCORE 2.0
Here\'s my code
public class Program
{
public static void Main(st
In my case I had faced this issue as I had added User Secret to my solution and later removed all of its content including { }. Please make sure the content in the file is with proper JSON format. Or try providing an empty object { } to the file if no information needed from it.
Same problem and solved by removing <UserSecretsId> </UserSecretsId>
from *.cproj
.
It was a bad user secret configuration
in m case I put extra { right before (above) "ConnectionStrings" :
in appsettings.json
I copied this from another file and assumed that "ConnectionStrings" :
must inside a curly braces {}
before
...
},
{ //<-- this one the culprit
"ConnectionStrings": {
"Dapper": "Server=.;Database=Dapper;Trusted_Connection=True;"
},
after
...
},
"ConnectionStrings": {
"Dapper": "Server=.;Database=Dapper;Trusted_Connection=True;"
},
I had this problem and the reason is that for some reason Visual Studio saves files with some invisible metadata that goes before the text therefore JSON reader cannot parse it.
You need to File -> Save As -> (Choose UTF-8 Without BOM)
.
I had the same problem.
I found that this problem seemed to have been caused by my appsettings.json
file.
I copied a version from another place to solve this problem.