How to get Current Project Directory path using C#

后端 未结 9 778
旧巷少年郎
旧巷少年郎 2020-12-31 08:19

okay, here is the question. I have two projects one is C# Console and other is Class library. I am accessing/calling Class library method from the console app. There is a fo

9条回答
  •  别那么骄傲
    2020-12-31 08:54

    I believe the problem is:

    Since the Console project has the DLL file reference it is using DLL to call any methods. At this time it is returning the class library projct's DLL location which is located in console project's bin directory and it doesn't know about the physical location of class library project.

    so essentially it is returning the same project path. I will have to move both projects in same directory in order to solve this issue.

提交回复
热议问题