0

我正在做一个中等级别的项目。Mysql 连接和其他东西运行良好,但后来在项目快结束时,突然出现了一个神奇的错误。

-- 系统在尝试在调用中使用指针参数时检测到无效的指针地址。

查看调试窗口:

'Santima Accounting Software.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Santima Accounting Software.vshost.exe Error: 0 : The system detected an invalid pointer address in attempting to use a pointer argument in a call
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in MySql.Data.dll
The thread 'vshost.RunParkingWindow' (0x3ec) has exited with code 0 (0x0).
The thread '<No Name>' (0xe18) has exited with code 0 (0x0).
The program '[2040] Santima Accounting Software.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).

-- 我已经尝试了一些方法来解决它 --

1 > restarting the computer.
   2 > Re installation of mysql connector.
   3 > reinstalling wamp.
   4 > searching google a lot and change a lot things in mysql settings.
   5 > Running project on different computer works fine but not in mine.

没有什么能帮助我。我还发现很多人和我一样有同样的问题,但在任何地方都没有解决方案。

我的设置以及我的项目如何设置:

我正在为本地环境使用最新的 wamp。我同时使用 Visual Studio 2010、2012 速成版。我正在使用最新的 mysql 连接器。

mysql上的用户结构:

请有人帮我摆脱这个垃圾。

4

2 回答 2

4

虽然这个问题是在近两年前报道的,但我打算写下我的答案,我希望有人觉得这些信息有用。这是我的环境:

  1. WIN7 X64

  2. VS2012终极版

  3. MYSQL 服务器 5.6.23 X86

  4. 适用于 Visual Studio 1.2.3 X86 的 MySQL

  5. MySQL 连接器/NET 6.9.5 X86

当我尝试通过 VS2012 IDE(NOT CODE) 连接 mysql 时,出现如下错误:

系统在尝试在调用中使用指针参数时检测到无效的指针地址

最后,我发现这个问题与 LSP(分层服务提供者)有关。我的计算机的 LSP 被某些 Web 加速器软件破坏了。

使用 CMD 命令行,执行以下命令修复 LSP:

netsh winsock reset

当然,您可以使用其他专门的工具来修复它。

于 2015-03-31T13:52:57.670 回答
0

只需将配置文件的 MySQL 连接字符串从 localhost 更改为127.0.0.1它即可解决您的问题。

于 2015-09-01T05:21:12.463 回答