Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Desktop Developer

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

Search

XML Feeds

Google Ads

« VB.Net: Adding ContainsAny and ContainsAll to ICollection(of T)F# Developer Center »
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

Problem

I keep forgetting that it needs the System.linq namespace to work. And I keep forgetting that it is not set by default on my projects. I try not to overuse linq but sometimes it is easy.

So what happened?

I was trying this:

  1. Dim nics As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
  2. Dim result = From e In nics


The solution

And it came up with this error and a squiggly line under nics.

Expression of type ‘1-dimensional array of System.Net.NetworkInformation.NetworkInterface’ is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider.

Hmm, not very helpful. What it is trying to say is that I have to add
Imports System.Linq to the file and then it works. Why can’t it just say that instead of that cryptic message? I will be so bold to suggest a rewrite of that error message.

Expression of type ‘1-dimensional array of System.Net.NetworkInformation.NetworkInterface’ is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the linq provider. This means add a reference to System.Core and an Imports System.Linq, have fun.

Or, of course, they could just do it for me, what good is an IDE if it can’t even solve the obvious mistakes?

About the Author

User bio imageChristiaan is a forensic technician who programs on the side, although my function description says that I do IT-things for 90% of the time . I'm an avid VB.NET fan and I use lots of the ALT.Net techniques, like unit-testing, nhibernate, logging, IoC, ...
Social SitingsTwitterLinkedInHomePageLTD RSS Feed
1104 views
linq, vb.net
submit to reddit Digg!FacebookDotnetkicks

Comments and Feedback

No feedback yet

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)