Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一些扩展,我需要从包含在 vsix 中的文件中提取数据。但是如果我使用 Environment.CurrentDirectory 我不会有这个文件,因为这个文件夹指向 VS 文件夹而不是扩展的文件夹。如何在运行时定义它?
System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase 获取执行 dll 的路径。