I get an error when i compile this program:
using System;
using System.Collections.Generic;
static class main {
public static void Main() {
Stack<int> a;
}
};
with this cmd:
C:\Users\tomc\Desktop\l>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc test.cs
I get this error:
test.cs(12,3): error CS0246: The type or namespace name ‘Stack’ could not be
found (are you missing a using directive or an assembly reference?)
However when using this command it builds fine:
C:\Users\tomc\Desktop\l>C:\Windows\Microsoft.NET\Framework64\v3.5\csc test.cs
Was Stack removed from .NET 4 ? I can’t find any indication that it was on MSDN.
The C# compiler has a default “configuration” file (called a response file) located in the .NET Framework installation directory (
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.rsp). This response file is just a text file that contains a set of compiler command-line switches that are passed by default when compiling a program. You can also specify your own file in addition to the default one (see the link above).In your case, this file might be missing or corrupted. You can check whether the references to the core libraries are present there. For example, here is the csc.rsp file from my machine: