EF6+.NET Framework+ Postgre issue
Maybe the title is confusing but i need help, i want a really basic code first app. I researched 3 days but i can't find any solution to this problem. When i try to enable-migrations PMC gives me this error. I can share my codes if you want. My connectionString is true.So don't ask me this please.
32 Replies
Seeing the code would be nice, yes
Also, ensure Postgres is actually running
Postgres is running, my java db is working rn
Kisiler.cs
your dbcontext registration/instantiation is the important part here
AppContext.cs
so where is the dbcontext getting the connection string from?
or is old EF weird and magic about how it works
App.config
i have to ask, is there a reason you're using such an outdated version of .NET?
app.config
Ah, it's 4.8
I know nothing about it, so you'll have to rely on our resident archaeologists for help lol
how can i use in winform application otherwise?
you can use winforms in .NET 8
wait a second
how?
Unless you mean webforms
i personally wouldn't, but there's nothing stopping you
dotnet new winforms
<UseWindowsForms>true</UseWindowsForms> in your csproj
or that
Or $newproject
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework.
.NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended.
https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
that would be another whole tier of issue
Winforms are old, yes, but still supported
Webforms are dead, and good riddance
well
not the ones running at my job
My condolences
actually i made with mvc model but i have to made with with windows forms
So can i work with efcore in .net 8 ?
Of course
i can't see any config file here? how can i add connectionstring to my project for npgsql?
https://stackoverflow.com/a/65675178/6042255 this could be of help
ef core is more flexible, as long as you can get it a DbContextOptions<MyDbContext> with the connection information it'll just work
or hardcode it in the context if you're just doing basic testing
Getting Started - EF Core
Getting started tutorial for Entity Framework Core
Thanks to everyone who tried to help me
Now this is