© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
204 replies
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

IIS Deploy ASP NET CORE Project
C#CC# / help
4y ago
.Net 6 on IIS (Port conflict)
C#CC# / help
4y ago
❔ Converting ASP.NET 6 to ASP.NET 5
C#CC# / help
4y ago