FanLife
FanLife
CC#
Created by FanLife on 7/17/2023 in #help
Unable to create an object of type 'DBCSDBContext'. For the different patterns supported at design t
Hey I've developed an application using Entity Framework Core and PostgreSQL, and I've encountered an error that I can't seem to resolve. When I try to create an instance of the 'DBCSDBContext' class, I receive the following error message: "Unable to create an object of type 'DBCSDBContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728". Here's some relevant information about my project: I'm using .NET 6.0 framework. The NuGet packages I've referenced in my project are as follows: Microsoft.EntityFrameworkCore.Design version 6.0.12 Microsoft.Extensions.Configuration version 6.0.1 Microsoft.Extensions.Configuration.Json version 6.0.0 Npgsql.EntityFrameworkCore.PostgreSQL version 6.0.8 I've checked my DbContext implementation, the configuration of my database connection string, and the project references, but I haven't been able to solve the problem.
4 replies
CC#
Created by FanLife on 10/30/2022 in #help
Dependency injection with multi project
Hi I have asp.net project and a console project which is in the same solution. I would like to launch a method which is in my console project but I want to launch it in asp.net. The problem is that the method I need to run need a dependency injection. How should I do it, because for the future I need to recall more methods between the two. in summary how can i manage dependency injection in multi project
3 replies