且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在同一解决方案中识别不同项目中的路径

更新时间:2023-11-22 19:15:40

为什么您的服务代码关注它来自的项目路径??这不应该是因为,当它在生产中时,项目将不在那里。



IIRC,它将是 Assembly.GetExecutingAssembly ().Location 。然后你只需使用 Path 类中的方法从那里获得你想要的路径。
Why is your service code concerned about the path of the project it came from?? It shouldn't be because, when it's in production, the project won't be there.

IIRC, it would be Assembly.GetExecutingAssembly().Location. Then you just use the methods in the Path class to get the path you want from there.