Unable to copy file "obj\Debug\Project.dll" to "bin\Project.dll"

Last post 07-07-2008 4:14 AM by FredyC. 6 replies.

Sort Posts:

  • Confused [*-)] Unable to copy file "obj\Debug\Project.dll" to "bin\Project.dll"

    07-01-2008, 4:33 AM
    • Loading...
    • FredyC
    • Joined on 05-14-2008, 7:15 AM
    • Posts 14

    Hi. This is really flustrating. When i compile my WebApplication, it works normally. But when i do refresh in browser, than IIS somehow "locks" that dll file and another compilation ends with this error:

    Unable to copy file "obj\Debug\Project.dll" to "bin\Project.dll". The process cannot access the file 'bin\Project.dll' because it is being used by another process.

    After restarting application pool in IIS, it's released and i can compile in standard way. I tried use handler.exe from sysinternals and it shows, that w3wp.exe process is using that dll. It's very time consuming before every compilation restart IIS. Any ideas where can be a problem please ?

    Microsoft Windows Server 2003 Standard Edition SP2
    IIS 6.0 

    Microsoft Visual Studio 2005 Professional
    Version 8.0.50727.762  (SP.050727-7600)
    Microsoft .NET Framework
    Version 2.0.50727 SP1
    Microsoft Web Application Projects 2005
    Version 8.0.50727.762
    Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack 1 (KB926601)

  • Re: Unable to copy file "obj\Debug\Project.dll" to "bin\Project.dll"

    07-03-2008, 3:21 AM
    • Loading...
    • Jorus
    • Joined on 05-14-2008, 9:32 PM
    • Melbourne Australia
    • Posts 188

    Hiya,

     Check out this KB http://support.microsoft.com/kb/311491/

    Cheers

    Jorus

    --Please put "Mark as Answer" if I help you solve your problem, Thanks.
  • Re: Unable to copy file "obj\Debug\Project.dll" to "bin\Project.dll"

    07-03-2008, 11:40 AM
    • Loading...
    • FredyC
    • Joined on 05-14-2008, 7:15 AM
    • Posts 14

    Thanks but that's not that case. Respectively i know that dll is locked by IIS Application Pool, but i don't know why and how to resolve this. I was trying figure out how to restart app pool from command line for pre-build steps, but i had no luck. I found only how to recycle pool, but that not solved issue. So i'm using "iisreset" in pre-build. It takes longer to restart whole IIS, but i don't need to manully reset pool before each compilation, which was main point of flustration. But some better solution would be nice...

  • Re: Unable to copy file "obj\Debug\Project.dll" to "bin\Project.dll"

    07-04-2008, 8:14 AM

    Hi,

    Based on my understanding, IIS hangs when you try to refresh the page. If I have misunderstood you, please feel free to let me know.

    To better understand your issue, please confirm the following information:

    • If we create a simple test project and refresh the page, does it have the same issue?
    • I guess some exception occurs in the IIS when you refresh page so that the IIS hangs and your application is locked by IIS process.

     

    In this case, a log will be very useful for the trouble-shooting. You can consider Windows Event Viewer which records the error of the applications.

     

    I hope this helps.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Unable to copy file "obj\Debug\Project.dll" to "bin\Project.dll"

    07-04-2008, 11:57 AM
    • Loading...
    • FredyC
    • Joined on 05-14-2008, 7:15 AM
    • Posts 14

     Well no, IIS doesn't hangs up. I have got that error message (from first post) when i compile project after refresh in browser so binary is loaded into IIS application pool and stays there "locked". I must then restart application pool to free that binary and then i can make successful compilation. Obviously no exception is thrown, it's compilation error. Event log doesn't contains anything, because it seems normal to the system.

  • Re: Unable to copy file "obj\Debug\Project.dll" to "bin\Project.dll"

    07-04-2008, 12:50 PM
    • Loading...
    • Sam.Dev
    • Joined on 12-12-2006, 10:54 AM
    • Posts 307
    Saima Ghumman
    --Mark the post as Answer if the Post helps you--
  • Re: Unable to copy file "obj\Debug\Project.dll" to "bin\Project.dll"

    07-07-2008, 4:14 AM
    Answer
    • Loading...
    • FredyC
    • Joined on 05-14-2008, 7:15 AM
    • Posts 14

    That is most closer to the problem, however after today restarting of computer it works without any problem. So i guess it was something wrong in the IIS (or somewhere else in the system) which caused locking dll. Thanks everyone for help even it was solved by restart.

Page 1 of 1 (7 items)
Microsoft Communities
Page view counter