C#C
C#3y ago
CptShape

✅ asp.net 6.0 + EntityFramework + IIS

I have a Web Api project, I set my ConnectionString on appsettings.json. In Program.cs I used the connection string to link with my DbContext. When I run the project on Visual Studio it works perfectly, when I publish it with IIS it doesn't work, it says "Page is not working". When I replace "return await _context.SalesData.ToListAsync();" with a handwritten data, page loads and shows the data so IIS works but EntityFramework doesn't work when published I believe. I couldn't find a solution anywhere, if anyone knows what I'm missing please help!
01.png
02.png
03.png
04.png
05.png
Was this page helpful?