How to dispose connections when using multiple data contexts in Asp.net MVC 4 with entity framework 6 - asp.net-mvc-4

I am using ADO.net SQL connection to my ASP.net MVC 4 project. I have used 8 data contexts. Entity Framework 6 is used. While I'm working on the project It hangs and gets 503 error.
I'm getting the following error message
The transaction operation cannot be performed because there are
pending requests working on this transaction.

Related

Is it possible to host single file asp.net core 5 blazor in iis?

I want to host single file asp.net core 5 blazor - published with produce single file - with iis? When I do that , IIS in windows server 2016 returns status code 500 that indicates internal server error.
Single-file deployments are not supported in IIS, This is a known limitation of in-process hosting at least in .Net 5.
Please refer below thread for more info.
https://github.com/dotnet/aspnetcore/issues/14473
500 internal error is generic issue, you may check full error message on the server. Have you installed your .net 5 bundled on server? You may refer to this tutorial https://windowswebhostingreview.com/simple-way-to-host-your-asp-net-core-in-iis/

asp.net mvc web application page loading slowness issue

we have developed an application using ASP.NET/C# MVC 4.0, SQL SERVER 2012 DB, Entity Framework, WCF Service.
application website is hosted on IIS 10 and the operating system used is Windows Server 2016 and this is standalone WEB server dedicated for our project.
application WCF web service is hosted using Windows Service and this is standalone APP server dedicated for our project.
application database is hosted on SQL Farm and this is a common database server, where other projects databases (more than 60) are also hosted.
application is already running absolutely fine in PROD environment from couple of years.
but suddenly from couple of months, we started facing as intermittent issue and i.e. application slow response
There are no errors, but the response time is too long, and sometimes it doesn't respond either, the browser keeps waiting for the web server.
customer has complained that his web application gets slow sometimes.
It happens at random times, the system just gets slow then after few hours (2-3) it gets back on track with normal response times.
this slowness issue is affecting only to one specific MVC View, whereas other MVC views are rendering correctly at the same time when slowness issue occurs.
error handling is already in place in the .net code, but nothing gets logged in error log file.
also DBA has confirmed that there are no issues on the SQL Farm and none of the other projects apart from us has reported slowness issue whose database is also hosted on the SQL Farm.
when tried to reproduce the same issue on UAT with the same PROD database copy & same user, was not able to reproduce it.
UAT environment is exactly similar for WEB & APP server.
only in case of UAT database server, we do not have SQL Farm here. we have standalone database server dedicated for our project.
here tried doing some R&D and verified few things, but still unable to resolve the issue.
so could you please guide me here that what should i do/verify to resolve this issue.
thank you in advance for your inputs.

How to use SignalR for Distributed Databases in MVC using LINQ queries?

I have three databases for a Web Application (MVC), if any change happens in any database reflect it in web application asynchronously.

Linq to SQL object in Win Phone 8

I have a Class Library which contains a Linq to SQL object which is then connected to a database. I also have a WCF Service for other apps.
I now decided to use the same database in a Windows Phone 8 application, so connected to the Web Service which was fine. Some of the methods require a Customer object so i tried to import the DLL library with Linq to Sql and i got an error that it cant be imported (unable to add specified project reference. the reference must be a windows phone project).
I done a search on this and found some threads with similar issues but nothing to state what workarounds if any i could use to connect to a WCF Web service which accepts a Customer object as part of its method.
So is there a workaround? Does the service need to be recreated from scratch? Or any other alternatives.

Hosting MVC 4 application on IIS error 500 due to class library reference

When i deploy my mvc 4 application to IIS locally it works. However when i deploy my mvc 4 app on another server it throws 500.
Now the issue here is that my MVC 4 application is using a class library as a database layer which is stopping it from running when its deployed on a remote server. I Tested this by deploying a default mvc 4 application on the server without a class library it launched fine.
But when i reference a class library(empty class library) and redeployed it stopped working (error 500).
The local copy is true on my class library. not sure why IIS doesn't like it.
Am i missing some obvious here?