0
When executing the command Add-Migration Setup for the creation of the table in SQL Server in PM the message below occurs even if I reference the api project with Shared. The system even processes something, but soon gives this error.
No Dbcontext was found in Assembly 'Youlearn.Api'. Ensure that you’re using the correct Assembly and that the type is neither Abstract nor Generic.
Follow the link from the solution
Hello Celio, it is recommended to leave error messages in text form in your question and not image.
– David Alves
@Davidalves Corrected, thank you.
– Célio Paiva
Have you set your context in the project that is trying to run the command? Look at my example:
<connectionStrings>
 <add name="EFContexto" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog=AgilManager;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\Agil.mdf" providerName="System.Data.SqlClient" />
 </connectionStrings>
– Victor Laio
My response helped?
– Renan
Hi Renan. Your answer helped me yes. After following your suggestion I still found another error corresponding to the lack of a constructor not created. Everything worked out, thank you!
– Célio Paiva