I'm getting the following error:
Error 25 The type or namespace name 'IEnumerable' could not be found (are you missing a using directive or an assembly reference?) C:\Development\Leverage\Leverage\Reports\SurveyLevel.aspx.cs 39 17 Leverage
because of this line:
private IEnumerable<string> GetDateParameters()
How do I deal with this? I tried to add in the line:
using System.IDisposable
at the top, but this doesn't fix it.
As others have said, you're missing using System.Collections.Generic;
.
But that's giving you a fish; we should be teaching you to catch your own fish.
The way to solve this problem on your own is:
Enter the name of the type into your favourite search engine, and see what comes back:
IEnumerable(T) Interface (System.Collections.Generic)
http://msdn.microsoft.com/en-us/library/9eekhta0
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
See the bit that I highlighted in bold there? That's the namespace that you're missing.
If you still get the error then you are likely missing a reference; you can find out which DLL you have failed to reference by clicking on the link and reading the documentation page; it will tell you which DLL to reference.
You are missing a using System.Collections.Generic;
statement at the top of the code file.
The generic IEnumerable<T>
type cannot be found directly.
You could declare the full name instead:
private System.Collections.Generic.IEnumerable<string> GetDateParameters()
IEnumerable
is in System.Collections
IEnumerable<T>
is in System.Collections.Generic
You just need to add System.Collections.Generic
namespace top of your code.
IEnumerable<T>
belongs on this namespace in mscorlib.dll assembly.
You can use it like;
private System.Collections.Generic.IEnumerable<string> GetDateParameters()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With