简体   繁体   中英

vs2003 : c# can not build visual studio solution

I get latest from source control and can not build my visual studio solution. I get the following error:

Cannot copy assembly 'XYZ' to file 'C:\\myfolder\\bin\\Debug\\XYZ.dll'. The process cannot access the file because it is being used by another process.

I have rebooted the machine but nothing seems to work. please help.

Use ProcessExplorer to determine what other process is holding the DLL open - my bet is that it is Visual Studio itself. Try closing down any open form Design windows (or all code/design windows in VS.Net for that matter) and see if you still get the same problem.

You can use the handle tool to determine what process is using that file:

handle XYZ.dll

From there, you can figure out what started the process and why it's using the file.

Whenever i've seen that error, it was because the program i was trying to compile was still running. You may want to check and make sure any debug sessions are stopped (not just paused, but stopped completely), and that your program doesn't appear in the Task manager under the "Processes" tab.

尝试将构建配置从“调试”更改为“发行”,然后再次尝试进行编译。

let's try a simple solution. The DLL in your bin directory is likely marked as Read-Only. Visual studio doesn't check out the DLLs from the BIN directory when you check out source files. So if you keep the binaries in source safe then you need to manually check them out or manually take off the read-only flag in the directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM