0

I am trying to compile a VB class into .netmodule, it refers to a motor control ActiveX file with namespace SCU

I am trying to compile a VB class into .netmodule, it refers to a motor control ActiveX file with namespace SCU

My command is:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Vbc.exe /t:module motorFunc.vb

But the compiler shows those errors: the compiler shows those error:

Any suggestions?

benkyou
  • 45
  • 9
  • You always need /r to get this code compiled, required to tell the compiler that you are using the types declared in the SCU interop library. If you don't have it yet then run tlbimp.exe. – Hans Passant Jul 20 '18 at 14:24

1 Answers1

0

The ActiveX reference to SCU will be a part of your .vbproj project file, not the .vb code file, so you can't just compile the .vb file by itself as it doesn't know how to find the reference from there.

I'm a little confused why you are compiling from the command line rather than just using Visual Studio. If you do want to build from the command line, I suggest you use MSBuild to build the whole project and not just the individual file.

wizzardmr42
  • 1,634
  • 12
  • 22