2

Hello I'm trying to compile my C# code into a .dll file to be used client-side in a VBA script.

My C# code references a SOAP Webservice and isn't behaving well. When I run csc /target:library file.cs I get the following errors CS0234 on com, and CS0246 BbsSecurityContext,BbsEntityResult (Classes within the webservice). It says that the com namespace does not exist in namespace SOAPTest. Please let me know if I can supply more information.

Here is a snippet of code from the file

...
using SOAPTest.com.blueberryhosting.broadviewbbsvcstg;
using System.Runtime.InteropServices;

namespace SOAPTest
{
    [Guid("9E5E5FB2-219D-4ee7-AB27-E4DBED8E123E")]
    [ClassInterface(ClassInterfaceType.AutoDual)]
    public class Webservice
    {
        private BbsSecurityContext sc;

        public Webservice(string apiKey, string sourceSystem, int userID)
        {
            createSecurityContext(apiKey, sourceSystem, userID);
        }
...
public void getInvestors(string filepath)
{
    using (BbsInteropWebService ws = new BbsInteropWebService())
     {
           BbsEntityResult x = ws.GetInvestors(sc);
           if(x.Success)
           {
           generateCSV(x,filepath);
           }
     }
}
...
Kyle Copeland
  • 479
  • 1
  • 3
  • 14

1 Answers1

1

Your snippet includes using SOAPTest.com.blueberryhosting.broadviewbbsvcstg;. I suspect you recieved the error because the csc.exe command you specified included only file.cs and that namespace was not defined in the file. Most likely it was defined in another code file or a library. You need to provide all dependencies when you invoke the compiler.

Command-line Building With csc.exe

How to use references when compiling c# code via command line

Community
  • 1
  • 1
Seth
  • 112
  • 9