[英]c# Error 1 The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?)
I'm trying to make a DLL of a base class that is inherited by classes in another DLL and I'm getting the above error when I name the namespace and the class anything but the default name. 我试图制作一个基类的DLL,该基类由另一个DLL中的类继承,当我为命名空间和该类命名时使用默认名称之外的名称时,出现上述错误。
This is what I want it to look like: 这是我想要的样子:
namespace SportsBaseClasses
{
class BaseClass
{
It works when it looks like this: 它的工作原理如下:
namespace ClassLibrary1
{
public class Class1
{
I'm using the appropriate "using" and I have it added as a reference. 我正在使用适当的“使用”,并将其添加为参考。 I've looked up this question half a dozen times and no one else seems to have this problem.
我已经六次查询了这个问题,似乎没有人遇到这个问题。 Thank you in advance for your help.
预先感谢您的帮助。
Try making BaseClass
public. 尝试将
BaseClass
公开。
namespace SportsBaseClasses
{
public class BaseClass
{
Or may be try 或者可以尝试
using ClassLibrary1.Class1
OR 要么
using BaseClass = ClassLibrary1.Class1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.