Note that there are some explanatory texts on larger screens.

plurals
  1. PONetwork Interface does not contain a definition for ""
    primarykey
    data
    text
    <p>I recently created this code for a WPF application that I was doing. The project where I'm reusing the code is a Windows 8 application. The code itself is the same so I don't really see what could be the issue. The only difference between them is of course the application and the .NET Framework being used. In the WPF application I was targeting .NET 3.0 and for the Windows 8 application I'm using .NET 4.5.</p> <p>As you can tell this is an extension method:</p> <pre><code>public static bool isTunnel(this NetworkInterface adapter) { return adapter.NetworkInterfaceType == NetworkInterfaceType.Tunnel; } </code></pre> <p>The error it gives for that method is:</p> <pre><code>Error 3 'System.Net.NetworkInformation.NetworkInterface' does not contain a definition for 'NetworkInterfaceType' and no extension method 'NetworkInterfaceType' accepting a first argument of type 'System.Net.NetworkInformation.NetworkInterface' could be found (are you missing a using directive or an assembly reference?) Error 4 The name 'NetworkInterfaceType' does not exist in the current context </code></pre> <p>In my model class I'm having a similar issue. On this line:</p> <pre><code>foreach (NetworkInterface adapter in NetworkInterface.GetAllNetworkInterfaces()) </code></pre> <p>it causes an error saying that the GetAllNetworkInterfaces() does not exist in NetworkInterface. Here's the exact error:</p> <pre><code>Error 15 'System.Net.NetworkInformation.NetworkInterface' does not contain a definition for 'GetAllNetworkInterfaces' </code></pre> <p>Is there something that I don't know about reusing code from WPF application in Windows 8 applications?</p> <p><strong>Update:</strong> Using the ianainterfacetype I was able to fix half of my extension methods because I was able to tell if they were Ethernet, Wireless, or Tunnel. I'm still searching for a way to tell if they were created by VirtualBox or VMware.</p> <p>For those who want to know about the ianainterfacetype you can find info <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.connectivity.networkadapter.ianainterfacetype.aspx" rel="nofollow">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload