1

我正在尝试创建一个 Web 应用程序。它在 localhost 上运行良好,但是当我在测试服务器上尝试时一直遇到此错误。我断断续续地查看了几天的其他问题并尝试了各种解决方案,但仍然没有解决错误

Compiler Error Message: CS0246: The type or namespace name 'courseDBLibrary' could not be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 6:  using System.Diagnostics;
Line 7:  using System.Collections;
Line 8:  using courseDBLibrary;
Line 9:  
Line 10: public partial class Charts : System.Web.UI.Page

courseDBLibrary 是引用的 dll 文件中的命名空间。该 dll 包含 2 个单独的 c# 文件,每个文件都有自己的类,位于同一命名空间下。dll 是通过添加引用对话框添加的。

最初 dll 被放置在项目根目录的 bin 中,但是当将它放在服务器上时,我已将 bin 文件夹移动到 wwwroot 文件夹。

最后,dll没有使用客户端配置文件框架(也就是使用 .NET Framework 3.5)

DLL 中的文件如下所示

namespace courseDBLibrary {
  public class class1 {
    ..

namespace courseDBLibrary {
  public class class2 {
    ..

引发错误的文件是一个相当复杂的 aspx 文件,后面带有 c# 代码,但是如您所见,编译器甚至没有到达类部分。

任何想法将不胜感激。

4

0 回答 0