I’m trying to compile a c# class (myClass, which implements ImyInterface) into a dll using vcvars32.
I get error CS0246: The type or namespace name ‘ImyInterface’ could not be found (are you missing a using directive or an assembly reference?).
Has anybody ran into this problem?
Note: it’s not
vcvars32which is failing here; it’s the C# compiler which is giving an error. You may have runvcvars32in order to set up your environment, but that’s very different.Only when trying to refer to a type that the C# compiler doesn’t know about. As the error message says, check your
usingdirectives (to make sure you’re importing all the namespaces you need) and your assembly references (to make sure you have a reference to the assembly containingImyInterface).Also check your spelling –
ImyInterfacewould usually beIMyInterface, and C# is case-sensitive.If
ImyInterfacedoesn’t exist within an existing library which you’re referencing – in other words, if you’re trying to build that interface into the same assembly – then you’ll need to include the source file containing the interface declaration on the command line.That’s about all we can say with no further information about where the interface is, what namespace it’s in, what namespace your class is in, etc.