简体   繁体   English

MySQLConnection在Visual Studio中引发异常

[英]MySQLConnection throws an Exception in Visual Studio

I don't know what is happening to my MySql.Data why it is always encountering an error when I am opening a connection. 我不知道MySql.Data发生了什么,为什么我在打开连接时总是遇到错误。

using MySql.Data.MySqlClient;

MySqlConnection myconn = new MySqlConnection();
myconn.ConnectionString = "server=192.168.0.xxx;port=3306;database=db_name;user id=root;password=pass123";
if (myconn.State == ConnectionState.Closed)
     myconn.Open();

then after myconn.Open(); 然后在myconn.Open(); is reach. 达到。

在此处输入图片说明

I am searching for that specific error here in stack but I don't see any answer. 我正在堆栈中搜索该特定错误,但没有任何答案。

PS: The code of MySqlConnection is working fine yesterday, but I don't know why that error appear a little while ago. PS: MySqlConnection的代码昨天工作正常,但我不知道为什么不久前会出现该错误。

PPS : I tried the code of MySqlConnection in different projects and It is working fine too, but When it comes to my real project it is not working. PPS:我在不同的项目中尝试了MySqlConnection的代码,它也可以正常工作,但是在我的真实项目中却无法正常工作。

Lately, I have some modifications to my project 最近,我对我的项目做了一些修改

like: 喜欢:

  • adding and removing some Application Settings 添加和删​​除一些应用程序设置
  • Changing the .Net Framework version from 4.0 to 4.6.1 vice versa. 将.Net Framework版本从4.0更改为4.6.1,反之亦然。

after of that many modification when the errors occurred. 经过多次修改后才发生错误。 and I think because of that, the MySqlConnection was affected and not working. 因此,我认为MySqlConnection受到了影响,无法正常工作。

Now I don't know why or how, but I solve my problem by changing the Assembly Information from 1.0.0.0 to 1.0.1.0. 现在我不知道为什么或如何,但是我通过将Assembly Information从1.0.0.0更改为1.0.1.0解决了我的问题。 Changing the Assembly Information will cause the compiler to reevaluate the configuration and cause the application to refrain from creating and reading a new user.config file corresponding to the new version due to there being no user settings in the new version. 更改程序集信息将导致编译器重新评估配置,并使应用程序避免创建和读取与新版本相对应的新user.config文件,因为新版本中没有用户设置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Program.cs 上的 Visual Studio 中断不在引发异常的行上 - Visual Studio break on Program.cs not on the line that throws the exception 解决方案在Visual Studio中构建,但Jenkins抛出资产异常 - Solution builds in Visual Studio but Jenkins throws an assets exception Visual Studio 2017 工作室显示错误“此应用程序处于中断模式”并引发未处理的异常 - Visual Studio 2017 studio showing error 'This application is in break mode' and throws unhandled exception 如何在Visual Studio C#命令MySqlConnection()上“设置SQL_MODE =” NO_AUTO_VALUE_ON_ZERO”; - how to “SET SQL_MODE = ”NO_AUTO_VALUE_ON_ZERO" on Visual Studio C# command MySqlConnection(); MVC 5应用程序RDLC报表在托管后引发异常,但在Visual Studio中可以正常工作 - MVC 5 application RDLC Report throws an exception after hosting but works fine with visual studio 如何调试在加载过程中引发异常的Visual Studio加载项? - How do you debug a visual studio add-in that throws an exception during loading? Visual Studio,调试在 mscorlib.dll 中随机抛出 SEHException 未处理的异常,没有 stackTrace - Visual studio, debugging randomly throws SEHException unhandled exception in mscorlib.dll with no stackTrace 用于 Visual Studio 的 Crystal Reports 使用子报表链接引发缺少参数值异常 - Crystal Reports for Visual Studio throws Missing Parameter Values exception with subreport links NSubstitute.Substitute.For<T> () 抛出 FileNotFound 异常,但仅在 Visual Studio 上使用 MSTest - NSubstitute.Substitute.For<T>() throws a FileNotFound exception but only using MSTest on Visual Studio Visual Studio中异常的位置 - location of exception in visual studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM