Arithmetic overflow exception when opening SQL connection

醉酒当歌 提交于 2019-11-29 09:22:04

I had the same problem. Lavasoft was also a reason. I checked in Program and Features if there is any Lavasoft program, and I was surprised to find application called WebCompanion of Lavasoft. I also found a running service LavasoftTcpService.

  1. I stopped the service LavasoftTcpService (from services.msc)
  2. I uninstalled WebCompanion from Program and Features.
  3. Two above mentioned dlls (LavasoftTcpService.dll and LavasoftTcpService64.dll in C:\Windows\System32 and C:\Windows\SysWOW64) were still there. I changed their name, and a problem dissapeared.

Before those steps I tried to only change dlls names and there was a problem to resolve localhost: instead of 127.0.0.1 system was looking for 0.0.0.0. Ping was giving me an error message "Ping request could not find host localhost. Please check the name and try again"

3 steps resolved the problem.

We had the same problem and it was caused by LavasoftTcpService64.dll. Getting rid of this, which is not that easy, fixed the problem. Check the following folders for its presence: C:\Windows, C:\Windows\System32 and C:\Windows\SysWOW64.

Credit goes to Nguyen Quy Hy for finding the root cause.

I confirm the culprit is Lavasoft Ad-Aware or WebCompanion. The System.OverflowException is thrown when calling SqlConnection.Open(). Only with LocalDB.

Interestingly, the crash occurs always if your app is a single instance application, otherwise it occurs randomly.

The solution is what Ursula said.

I had the same problem which prevented installation of Azure Storage Emulator i.e. AzureStorageEmulator.exe start produced a similar stack trace and exception. I could init the emulator but not start it. Removal of the Lavasoft dll and resetting the winsock stack did the trick. So worked for me and likewise credit to Nguyen Quy Hy and this post.

i had the same problem while creating user through entityframework and i found the solution and fix the problem by doing following steps

  1. Stop LavasoftTcpService64 service from services and
  2. Uninstall the web-companion from program and features and it started working in case if the problem still exist restart your machine hope it will help.

I Just encountered this error myself and option #2 from here helped me.

  1. Please, start Command Prompt as an administrator by right-clicking it and select Run as administrator.

  2. Enter this command to reset the network adapter (end with the Enter key):
    netsh winsock reset

  3. Restart the computer.

  4. Please, delete these two files:
    C:\WINDOWS\system32\LavasoftTcpService64.dll C:\WINDOWS\SysWOW64\LavasoftTcpService.dll (only for 64-bit Windows)

I renamed the files instead of deleting.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!