Hey guys,

I'm really puzzled about this error:

Error 1 Feature 'generics' cannot be used because it is not part of the standardized ISO C# language specification C:\Documents and Settings\John Rudd\Desktop\dissertation\custom_plugin\myProtocolPlugin\myProtocolPlugin\Commands.cs 9 54 myProtocolPlugin

Generics IS supported, I've done it on more than one occasion in the same manner too.

Here's the code:

using System;
using System.Collections.Generic;
using System.Text;

namespace myProtocolPlugin
{
    class Commands
    {
        private Dictionary<String, int> hashtable = new Dictionary<String,int>();
    }
}

Recommended Answers

All 4 Replies

Look at: http://msdn.microsoft.com/en-us/library/63abbwzw.aspx

Compiler Error CS1644
Error Message
Feature 'feature' is not part of the standardized ISO C# language specification, and may not be accepted by other compilers

This error occurs if you specified the /langversion option ISO-1 and the code you are compiling uses features that are not part of the ISO 1.0 standard. To resolve this error, do not use any of the C# 2.0 compiler features such as generics or anonymous methods with the ISO-1 compatibility option.

The following sample generates CS1644:

// CS1644.cs
// compile with: /langversion:ISO-1 /target:library
class C<T> {}   // CS1644

It appears you are using /langversion in your build which is causing the problem

Hmm interesting. Well I've *fixed* it but just out of interest, what consequences could this have? Cheers for pointing me in the right direction

Right click on your C# project (not the solution) -- select properties. On the left side select the "build" option. Click the "Advanced button in the lower right corner. The top combo box in that screen is the language. Change it to "default"

commented: Right! +8

To be honest I don't know the answer to that. I didn't know about this option until you posted the error message I started looking around MSDN.

Please mark this thread as solved if your question has been answered and good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.