【发布时间】:2019-11-04 01:40:28
【问题描述】:
我创建了一个自定义库 (test.dll) 并创建了一个引用我的库的控制台应用程序。当然我在VS中添加了参考。所以代码是这样的:
//use the type in test.dll
Car c = new Car(); //Car is defined in test.cs which compiled into test.dll
c.SpeedUp();
string pID = Console.ReadLine();
int theProcID = int.Parse(pID);
theProc = Process.GetProcessById(theProcID);
ProcessModuleCollection theMods = theProc.Modules;
foreach (ProcessModule pm in theMods)
{
string info = $"-> Mod Name: {pm.ModuleName}";
Console.WriteLine(info);
}
所以我通过任务管理器找到了控制台应用程序的进程ID,然后我输入了ID,但是我在列表中找不到'test.dll',我可以看到很多其他的dll,例如'mscore.dll'、'mscorlib.ni.dll'、'user32.dll 等',我到底哪里出错了?
顺便问一下,“mscorlib.ni.dll”和著名的“mscorlib.dll”有什么区别?
【问题讨论】:
-
代码是否使用了库?它们在使用之前不会加载到内存中
-
@SamiKuhmonen。是的,我确实使用了这个库,甚至创建了几个在 test.dll 中定义的类实例。
-
你能加一个minimal reproducible example吗?
-
关于 mscorlib.ni.dll:尽量不要同时提出多个问题。您已经可以在 StackOverflow 上找到答案,例如 here
-
我没有看到任何来自您的 test.dll 的清晰内容
标签: c# .net clr .net-assembly