Last post May 31, 2013 07:10 AM by ZaheerJimmy
May 31, 2013 07:10 AM|ZaheerJimmy|LINK
I have been suggested to post this problem to this form by "VS General Question forum" under http://social.technet.microsoft.com/Forums.
I am getting the error "A socket operation was attempted to an unreachable network" inconsistently in ASP.NET 4.0 Web App only when Web App is hosted on "Windows Server 2008 R2 SP1 - 64-bit" machine. My Web App uses:
Visual Studio 2010
MySql Server 5.0
MySql Connector 6.6.5
The same App works well on "Windows Server 2003 R2 - 64-bit" machine. Please suggest some solution to this. Be noted that, it is able to connect to MySql but It's connection behavior is flaky i.e. it breaks with the said error randomly but not always.
How to repeat:
1. Create a web app in ASP.NET 4.0 using Visual Studio 2010.
2. Add Entity Model from database in MySql Server (InnoDB) hosted on Linux server.
3. Write a code to connect database & fire select query.
4. Compile it publish it on a windows 2008 server R2 64-bit. it should break in to following error:
"A socket operation was attempted to an unreachable network"
In addition to the above info, Please be notified that the website hosted on the same server works well with "MS SQL Server 2008 R2" hosted on a different Database Server.
The TCP server/ports does not create any problem with "MS SQL Server 2008 R2" but when it tries to connect MySql Server through "MySql Connector 6.6.5", it gives the above message that has the correct port# 3306 but some non-existing IP like 0.0.12.234:3306.
Please revert with some solution to this as the website is required to go live very soon.
Please do not suggest to put it on some other forum as I have been roaming with this to forum to forums without any solution. Please refer to other forums responses below: