在同一解决方案中识别不同项目中的路径 [英] Identify the path in Different projects in the same solution

查看:63
本文介绍了在同一解决方案中识别不同项目中的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个解决方案,有3个不同的Projects.One是我的项目,另外两个与service.i在我的项目中有一个文件夹。如何从我的服务访问该文件夹。(我需要路径)



提前谢谢。

I have a Solution with 3 different Projects.One is my Project and another two are related to service.i have one folder in my project.How i can access that folder from my service.(i need the path)

Thanks in advance.

推荐答案

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



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.


这篇关于在同一解决方案中识别不同项目中的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆