Hi Chris,
I recently purchased a Netduino 3 Ethernet running the latest MF 4.3 firmware update.
In the past I've been setting the static IP address for my Netduino Plus 2 using .NET MF 4.2 as listed below:
public static void Main()
{
//Set the Neduino Plus 2 Static IP
NetworkInterface.GetAllNetworkInterfaces()[0].EnableStaticIP("172.24.16.98", "255.255.255.0", "172.24.16.1");
string localip = NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress;
Debug.Print("The local IP address of your Netduino Plus 2 is " + localip);
// Create and initialize the program instance
Program Initiate = new Program();
Initiate.InitTimers();
//Thread.Sleep is necessary to keep the program running
Thread.Sleep(Timeout.Infinite);
}
I created a test program for my Netduino 3 Ethernet with the same NetworkInterface information.
When I deploy and debug the application I get the error "An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll" at the line of code NetworkInterface.GetAllNetworkInterfaces()[0].EnableStaticIP("172.24.16.98", "255.255.255.0", "172.24.16.1");
I've referenced SecretLabs.NETMF.Hardware.Netduino for the device. Static IP is also enabled with MFDeploy.
Is there another networking related reference I need to add to my application and possibly a different method for setting a static IP than above?