如何使我的图书馆使用指导性?
我创建了一个使用.NET 6.0的类库,该库看起来像这样:
namespace MyLib
{
public static class MyLib {
public static void someFunction() { }
}
}
我创建了一个Nuget软件包,并将该软件包添加到另一个应用程序中。我的期望是,我将使用mylib 在类的顶部放置,然后可以在代码中调用
mylib.somefunction()
。但是,相反,我始终必须调用mylib.mylib.somefunction()
,使用使用
- drilective-dricevelative note。
有人可以向我解释我做错了什么吗?
I created a class library with .Net 6.0 which looks like this:
namespace MyLib
{
public static class MyLib {
public static void someFunction() { }
}
}
I created a nuget package and added that package to another application. My expectation was that I would put using MyLib
at the top of a class and then could call MyLib.someFunction()
in the code. But instead, I always have to call MyLib.MyLib.someFunction()
, with the using
-directive doing nothing.
Can someone explain to me what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论