Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a property in .NET Type, which is actually a generic list of objects. When I try access the property using numeric index e.g. 10, this works. However when I iterate through indices using indexer such as i, then I get error "NET::nofield: No public field or property named i exists for the .NET type ..."

How to resolve this?

share|improve this question
Could you please share your Mathematica code that is causing the error? – rhermans Apr 1 '14 at 15:04
up vote 3 down vote accepted

I figured it out, I need to use Item indexer, but item index starts from 0, not 1:

If you write a class in C# and give it an indexer, the compiler creates a public property named Item for you. This is a parameterized property, meaning that it takes an argument like a method call. The indexer syntax is just a shorthand for calling the Item property.


Calling .NET from the Wolfram Language: Indexers

share|improve this answer
It would be great if you could add some simple example code to this answer. It will make it more useful for anyone else facing the same problem who finds this Q&A. – Simon Woods Apr 1 '14 at 15:56
i added more details and direct link – denfromufa Apr 20 '14 at 4:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.