views:

473

answers:

1

Hi, this is a very newbie question, sorry!

I need to create an aspx website based con C# and am calling some webservices based on some DLL's I already have. Beforem purchasing Visual Studio, I decided to try Microsoft Visual Web Developer Express (is this ok?) creating a Web Application ASP.NET based on Visual C#.

I created the form to enter the data which is submitted when clicking the process button. At this point I need to call stuff from the DLL, which I have added in the Solution Explorer via Add Reference, selecting the DLL from the COM list. But whenever I run the project, I always get the error "the type or namespace xxx cannot be found - maybe a using directive or assembler directive is missing" when trying to create the object.

What is my stupid mistake?

Thanks!

A: 

If you look at the error message, there is another half that you havent covered. At the top of each code file that you want to use the namespace from your DLL, you need to include a "using directive" to let the compiler know that it may be linking to that DLL during compilation. Basically the compiler is wondering where something is, and even thoguh you included it in the function, you didnt take the final step of adding in the using statement at the top of the file.

Scott M.
Actually I did add the using directive after that error, followed by the name of the DLL, but keep getting the same error. Exactly how should the using command reference the DLL? Thanks!
Use class view and Intellisense to get the correct namespace(s) and name(s)
Henk Holterman
the using directive tells the compiler the namespace, not the name of the DLL. You told it the name of the DLL when you referenced it in your project.
Scott M.
Ok, I checked using the class view. The DLL is Interop.XXCLIENTXLib.dll. I open it and the namespace is XXCLIENTXLib (after the curly brackets) composed of three elements: Client, Clientclass and IClientSo I add after all the default using statements the statementusing XXCLIENTXLib; and I still get the same mistake, that the XXCLIENTLib namespace cannot be found