【发布时间】:2013-12-05 21:43:45
【问题描述】:
在构建 vs 项目时,构建失败并出现以下错误:
Error 3846 Could not write to output file 'obj\Debug\app.exe' --
'The process cannot access the file because it is being used by another process. '
但是,当我使用解锁器查看锁定文件的内容时,没有找到阻塞进程? 使构建工作的唯一解决方案是手动删除'obj\Debug\app.exe'文件。
在整个项目中,我们收到以下警告:
Warning: the type x in 'E:\\ProjectDir\CustomClass.css' conflicts with the imported type x
in 'obj\Debug\app.exe'. Using the type defined in 'E:\\ProjectDir\CustomClass.css'
我怀疑此警告是导致项目无法构建的原因。 但是,我不知道为什么类型冲突,或者 VS 在做什么??
有什么想法吗?
编辑: 正如 kostas ch. 所建议的那样,重命名输出文件 (app.exe -> app2.exe) 会使构建再次工作。但是,同样的警告仍然存在并且仍然提到旧的 app.exe 名称?删除 obj\Debug 文件夹中的 app.exe 会产生一个新警告,这一次它提到了 bin\Debug 中的 app.exe。删除该文件会使警告消失,并且项目继续正常构建。 但是,将输出文件重命名为旧名称 app.exe 时,返回相同的错误 .. ??
我不知道发生了什么,但我很高兴解决方法,感谢 kostas.ch!
【问题讨论】:
-
重命名 app.exe。我之前遇到过同样的问题,但我没有找到任何解决方案。
-
感谢 kostas.ch,请将此评论作为答案发布,以便我将其标记为已接受的答案。
标签: c# .net visual-studio-2008 build