13

As you can probably tell by my question, I am a complete noob at this whole thing (namely, downloading open-source projects, and Visual Studio 2010). I wanted to study the code, find out how it works, adapt my own version that dumps relevant data in a database, but really, I only got as far as loading the solution in VS 2010, hitting the "Start Debugging" button, and then:

The working directory does not exist: 'D:\Dev\CodeProject\articles\smartcardfmwk\Smartcard_Framework

How can I fix this error? I tried googling it, but none of the solutions fit the bill properly.

The source code in question is Smart Card Framework, from Code Project:

http://www.codeproject.com/Articles/16653/A-Smart-Card-Framework-for-NET?msg=4609259#xx4609259xx

I downloaded the "Updated Project (VS2010)" and I can open it in VS2010, as well as build, but debugging just wouldn't work.

I did not try replicating the path yet, but as this is a working project, my company requires that it is placed on a very specific location accessible by others.

Thanks.

4

3 回答 3

30

没关系,我明白了。太简单了,很抱歉浪费了任何人的时间。

源解决方案下有很多项目。我认为其中至少有一个指向一个不存在的目录,所以我涉足项目,

  • 我右键单击一个项目并单击属性
  • 这将打开 ProjectName 属性选项卡
  • 在 Debug 选项卡下,有一个名为“Working Directory”的文件;我将其更改为项目当前所在的位置。

现在,这解决了我的问题,除非我错过了一个项目。不过,我想知道,如果我将解决方案移到其他地方,是否必须再次执行此操作。

于 2013-07-15T03:31:56.827 回答
1

在导入/升级旧 C# 项目后,这也发生在 VS 2019 中。我看不到任何要更改的项目属性。最后通过手动编辑文件来修复它<ProjName>.user.csproj,如下所示:

代替

<StartWorkingDirectory>[wrong directory name]</StartWorkingDirectory>

<StartWorkingDirectory>.\</StartWorkingDirectory>
于 2019-06-13T17:55:07.680 回答
0

我也遇到了工作目录不存在的问题,但我设法解决了。每当发生此错误时,都需要正确执行某些步骤。

  1. 在 VS 中,在工具栏上打开“项目”。
  2. 然后去项目属性。
  3. 选择调试并检查您的工作目录。如果路径错误,请浏览它...
于 2021-12-23T10:46:16.220 回答