简体   繁体   English

在DLL C#中访问单独的类

[英]accessing separate classes in a dll C#

im trying to access a few classes i have in a dll. 我试图访问我在dll中的几个类。 below is my dll (utils) and the classes that im trying to access inside of it (delim). 下面是我的dll(utils)和我试图在其中访问的类(delim)。 but the only thing that i can access and use in the utils dll is kb.cs. 但是我可以在utils dll中访问和使用的唯一东西是kb.cs。 i have no access to mouse.cs or delim.cs. 我无权访问mouse.cs或delim.cs。 which are the two that im in need of using. 我需要使用的两个。 在此处输入图片说明 here is how im trying to access it. 这是即时通讯尝试访问它的方式。 i have it in references, as you can see on the right hand side of the image. 我在参考文献中有它,如您在图像的右侧所见。 and i also have "using utils;" 我也有“使用工具”; in there 在那里 在此处输入图片说明

what am i doing wrong? 我究竟做错了什么?

delim must be declared public for the class to be visable in other assemblies (dll's and exe's) 必须声明delimpublic类,才能在其他程序集(dll和exe)中看到该类

public class delim
{
   ...
}

默认情况下,类是internal类。这意味着您不能从类的程序集外部访问它。您需要将类public

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM