使用 Microsoft Visual Web Developer Express 2008 创建网站时出现问题
这是一个非常新手的问题,抱歉!
我需要创建一个基于 C# 的 aspx 网站,并基于我已有的一些 DLL 调用一些 Web 服务。 在购买 Visual Studio 之前,我决定尝试 Microsoft Visual Web Developer Express(可以吗?)创建基于 Visual C# 的 Web 应用程序 ASP.NET。
我创建了表单来输入单击处理按钮时提交的数据。 此时,我需要从 DLL 中调用内容,我已通过“添加引用”将其添加到解决方案资源管理器中,并从 COM 列表中选择 DLL。 但是每当我运行该项目时,在尝试创建对象时总是会收到错误“找不到类型或命名空间 xxx - 也许缺少 using 指令或汇编程序指令”。
我的愚蠢错误是什么?
谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您查看错误消息,您会发现还有另一半内容没有涉及到。 在要使用 DLL 中的命名空间的每个代码文件的顶部,您需要包含一个“using 指令”,让编译器知道它可能在编译期间链接到该 DLL。 基本上,编译器想知道某些东西在哪里,即使您将其包含在函数中,您也没有采取在文件顶部添加 using 语句的最后一步。
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.