The PostgreSQL database was recently used in the project, so I thought I would build it with the most recent hot net core. First of all must be in the blog Park followed the footsteps of the Great God walk ... But also met a lot of pits, below I one by one way.
(1) When initializing the entity object from the PostgreSQL database, the "scaffold-dbcontext" command is required, but always error! The error is as follows:
The term ' scaffold-dbcontext ' isn't recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again!
The back is a variety of debugging, a variety of data search. One of the following things was done:
1, upgrade PowerShell to 5.0 (the result is of course not!) So this should not be the solution! )。
2, the stackflow above to see the use of Dotnet-restore command, but the result is still wood useful!
3, later, I in Project.json inside of "dependencies add in the following this dependency, results!!" It's all right! I was adding this to the "Tools" project, and I thought that would be enough! What a good thing to take for granted!
1 " : { 2 " version : " 1.0.0-preview2-final , 3 type ": " build 4 }
Before reading the article said, Project.json will be replaced, do not know what will be, but from today's practice, all rely on the library, must be placed under the dependencies item, as for "tools", do not know which should be put in, have to know, trouble to tell! Thanks a lot...
Some issues with the. Net Core use of PostgreSQL to build projects