Visual Studio 工作目录 [英] Visual Studio working directory
问题描述
看起来有与我类似的问题,但他们有我宁愿避免的解决方法.
It looks like there are similar question to mine, but they have workarounds that I would rather avoid.
我的项目中有一个 bin 文件夹,其中包含运行程序所需的所有动态库.
I have a bin folder in my project that contains all the dynamic libraries needed to run the program.
所以为了让程序找到dll,我在
So to let the program find the dll, I have set the Working Directory in
Project Property Pages -> All Configurations
-> Configuration Properties -> Debugging -> Working Directory
不幸的是,我对未找到库的错误感到非常高兴.看起来VS在运行程序之前不会更改工作目录.
Unfortunately I am greated with an error that the libary has not been found. It looks like VS does not change the working directory before running the program.
我是否遗漏了什么或者这是一个没有修复的已知错误?
Did I miss something or is this a known bug without a fix?
推荐答案
当前没有可用的 VS,但我通常将所有共享库添加到我的 PATH
变量中.只需添加为环境变量
Don't have VS currently available but I usually add all shared libraries to my PATH
variable. Just add as environment variable
我知道这不是对您问题的直接回答,但我希望它无论如何都会有所帮助
I know it's not a direct answer to your question but I hope it helps anyway
这篇关于Visual Studio 工作目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!