小编she*_*ang的帖子

C#子类同时保持名称.深伏都教?

我有一个我正在使用的DLL,它包含一个类foo.Launch.我想创建另一个子类Launch的dll.问题是类名必须相同.这被用作另一个软件和foo.Launch类的插件,它是启动插件的敌人.

我试过了:

namespace foo
{
    public class Launch : global::foo.Launch
    {
    }
}
Run Code Online (Sandbox Code Playgroud)

using otherfoo = foo;
namespace foo
{
    public class Launch : otherfoo.Launch
    {
    }
}
Run Code Online (Sandbox Code Playgroud)

我也尝试在引用属性中指定别名,并在我的代码中使用该别名而不是全局,这也不起作用.

这两种方法都不起作用.有没有办法可以在using语句中指定要查看的dll名称?

.net c# c#-3.0

4
推荐指数
1
解决办法
314
查看次数

标签 统计

.net ×1

c# ×1

c#-3.0 ×1