Problem with TCP/IP pinging EMX module

Hello everyone,
I have a problem with TCP connection to EMX module through switch and even without it. Command line tells me " Answer from 192.168.137.3: destination host unreachable". Firewall is turned off.
What I have:
EMX
[ul] Staic IP 192.168.137.25, Mask 255.255.255.0, Gateway 192.168.137.1 [/ul]
[ul]MAC address 00-21-03-80-2B-7D [/ul]

My PC

[ul]IP 192.168.137.3,Mask 255.255.255.0, Gateway 192.168.137.1 [/ul]

I got the error in this line:

IPAddress ip = IPAddress.GetDefaultLocalAddress();

The output is:

#### Message: 
    #### Microsoft.SPOT.Net.SocketNative::getaddrinfo [IP: 0000] ####
    #### System.Net.Dns::GetHostEntry [IP: 0008] ####
    #### System.Net.IPAddress::GetDefaultLocalAddress [IP: 0049] ####
    #### FTPServer.HttpServer::StartHttpServer [IP: 0023] ####
    #### SocketException ErrorCode = -1
    #### SocketException ErrorCode = -1

What could it be???
Ugeen.

What version framework are you using, and what version is your SDK?

Here I define my network and IP:

Microsoft.SPOT.Net.NetworkInformation.NetworkInterface NI = Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0];
            NI.EnableStaticIP("192.168.137.25", "255.255.255.0", "192.168.137.1");//195.113.219.160
            byte[] mac = new byte[] { 0x00, 0x21, 0x03, 0x80, 0x2B, 0x7D };
            NI.PhysicalAddress = mac;
            //Starting http server pages
            ThreadStart tStart = new ThreadStart(HttpServer.StartHttpServer);//this method is from the sample

            Thread socketThread = new Thread(tStart);
            socketThread.Start();

            Thread.Sleep(500);

Project version is NETMF 4.2 and SDK is Premium 4.2

we really need to know the exact version of the SDK. You should have 4.2.9.0, the latest… released only a few days ago !

Open c:\program files\GHI Electronics then into the 4.2 Premium folder, look at the release notes file there, and you should see the versioning info like this:

SDK Version 1.0.2
February 14, 2013

• EMX v4.2.9.0, TinyBooter v4.2.9.0
• G120 v4.2.9.0, TinyBooter v4.2.9.0
• GHI Premium NETMF Library v4.2.9.0

@ andre.m Sorry, but I did’t understand where you defined

ethernet_J11D

@ Brett I have
SDK Version 1.0.0
November 29, 2012

Version Info

Important Note: Requires .NET Micro Framework 4.2 QFE2 and Visual Studio 2010

• EMX v4.2.7.0, TinyBooter v4.2.7.0
• G120 v4.2.7.0, TinyBooter v4.2.7.0
• GHI Premium NETMF Library v4.2.7.0

@ andre.m
Yes, I have installed SDK 4.2.9 but it did’t help. My project type is “Console application” in Micro Framework pattern.

You wrote: “you are using the built in ethernet network interface, correct?” Sorry, but I didn’t understand.

I have EMX module soldered on circuit board with SD and Ethernet connectors. I’m using cable connection.

@ andre.m - I tried this code, but VS doesn’t like that method

AssignNetworkingStackTo(NI)

needs input type

 NetworkInterfaceExtension, not  NetworkInterface.

And VS can’t convert it :frowning:

Yes, this code eventually works! Thank you.