1

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!

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236
  • I have to add a DLL file, when I add it to the References, it shows up on the COM list. Sorry, I am learning! –  Apr 21 '09 at 19:57

1 Answers1

0

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.
  • 7,313
  • 30
  • 39
  • 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! –  Apr 21 '09 at 19:48
  • 1
    Use class view and Intellisense to get the correct namespace(s) and name(s) – H H Apr 21 '09 at 19:52
  • 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. Apr 21 '09 at 20:17
  • 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 IClient So I add after all the default using statements the statement using XXCLIENTXLib; and I still get the same mistake, that the XXCLIENTLib namespace cannot be found –  Apr 21 '09 at 21:42