简体   繁体   中英

Linq query runs fine on local machine, but get “The connection was reset” error on the server

I have a complex linq query with many joins, and other business rules, that is working fine on my local machine, but when it's deployed to the server, I keep getting a connection is reset error.

I split the query and made to visits to the server, and the error went away, but after adding a few more things to the query I'm getting it again.

Upon investigation it seems that the App pool is stopped IIS, as if the process is getting terminated by the server.

Although the query is complex, the outputted SQL executes in 14 seconds. Does anyone know what could be happening or have any tips for debugging / solving this?

Can you try to set CommandTimeout to Zero in your connection and Try again.

Please Make sure "After Adding few more things" Extra Query not have any difference between your local and server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM