Attention: We are retiring the ASP.NET Community Blogs. Learn more >

No more DLL Hell, replaced with Visual Studio Hell

I am grateful for no longer having to deal with COM and Dll hell.  Now, instead I battle daily with the VS IDE 1.1.  How many times a day do I see this:

F:\Projects\AMNET\CDS Controls\CustomControls\obj\Debug\CustomControls.pdb The file 'F:\Projects\AMNET\CDS Controls\CustomControls\obj\Debug\CustomControls.pdb' cannot be copied to the run directory.  The process cannot access the file because it is being used by another process.

or this:

F:\Projects\AMNET\CDS Forms\Maintenance\frmMaintenance.vb(53): 'SuspendLayout' is not a member of 'CustomDataSystems.AMNET.Forms.Maintenance.frmMaintenance'.

or this:

F:\Projects\AMNET\CDS Forms\Maintenance\frmMaintenance.vb(15): Type 'frmAncestor' is not defined.

or this:

 The designer could not be shown for this file because none of the classes within it can be designed.


times 300

Solution? Shut down the IDE, delete the bin folder, do a restart, stand on my hand, run around my desk 5 times, throw salt over my left shoulder and then hold my breath.  Wow this is frustrating.

 

 

 

 

 

19 Comments

  • <i>"F:\Projects\AMNET\CDS Controls\CustomControls\obj\Debug\CustomControls.pdb The file 'F:\Projects\AMNET\CDS Controls\CustomControls\obj\Debug\CustomControls.pdb' cannot be copied to the run directory. The process cannot access the file because it is being used by another process."</i>



    This error happens when you're doing WinForms apps, and you try to rebuild without terminating the running instance of the application. When building WinForms apps, always make sure you code a Close button that calls Application.Exit.



    Can't help you with the other ones.

  • Hehe this is why I wend back to vs2002, let allone the fact that vs2003 deletes the config files while using nunit as a testing client.



    ps: use an automated build and deploy system... use attach process to debug through your program, saved me a' bit of pain.

  • This happens to me in Winform and Webform projects. Luckily not lately though. I usually have to clear out the vswebcache for web apps that have the problem. Throw in an IDE restart for good measure and I'm off again for a bit.

  • I used to have the same problem and it was solved for me when I aked Index Service to no index my temporary folders.

    It seems that Index Service lock the files VS use, so obviously VS can't overwrite those files.

  • Stopping the index service helped us a lot - especially when things would be ok then start screwing up for no obvious reason. It still is an occasional problem. Also keeping the solution very small, we use a nightlybuild to build everything, keeps the problem to a minimum. Part of this is to build to a common directory instead of using the obj and bin directories. Sometimes just getting out of the IDE isn't enought either. Sometimes you have to wait several seconds for the IDE to really finish.

  • The same answer applies for those of us screwed with 2002: upgrade to the next version! Pay for our bug fixes! SCREW YOU AND GIVE US YOUR MONEY -- $60 *BILLION* plus isn't enough for us...

  • From MSDN:



    If you get the following error the aspnet worker process is locking the Web-based DLLs. Take the corrective steps that follow.



    Could not copy temporary files to the output directory.



    The file 'bin\HowToBuildWebServices.dll' cannot be copied to the run directory. The process cannot access the file because it is being used by another process.



    The file 'bin\HowToBuildWebServices.pdb' cannot be copied to the run directory. The process cannot access the file because it is being used by another process.



    Press CTRL + ALT + Delete to open the Windows Task Manager.



    Click the Processes tab.

    Click the Image Name ListView header to sort aspnet_wp.exe to the top.

    Click aspnet_wp.exe and then click End Process.

    Close Windows Task Manager.

    To run the Windows Forms client:



    In the Solution Explorer, right-click VB.NET How-To Build Web Services (Client) and then click Set as StartUp Project.

    Press F5 to build and run the sample.

    Sample Customer ID values are COMMI, GODOS, and ISLAT.

  • You CAN have indexing service on, but you have to mark a certain folder as not allowed to index



    C:\WINNT\Microsoft.NET\Framework\(Framework version(s))\Temporary ASP.NET Files



    Right-Click on it, select Properties, Advanced, and UNCHECK the indexing checkboxes and reboot.



    Do this on all development machines as well as webservers.

  • If I recall, this has to do with windows forms when you are create a form type marked as MustInherit. remove the MustInherit and you should be good to go, or create a debug and release version of the type.

  • It can be the option "copy local" is false in the project property. Make it true.

  • Dear samuel,

    your solution doesn't work for my project. It can be a problem of application cache?

    It's the only web project on server that doesn't not overwrite dlls. It only overwrites them after some minutes of compile tries...



    Any idea?



    tnx



    MarkOk

  • I am getting the same error with VS.NET 2005. When I try to attach to the worker process, VS does not stop at any breakpoints. After the attempted attachment I can no longer rebuild the solution. The aspnet worker process is now locking the obj\{myname}.dll.

  • The problem is simple: You're getting salt in your computer. :)

    Solution: Shut down the IDE, delete the bin folder, do a restart, stand on my hand, run around my desk 5 times then hold my breath.

  • It seems incredible that I am still finding comments such as these and there still no fix supplied by Microsoft (unless I missing something!)

  • I have a simular problem. Reading from text files into a windows form and releasing all resources to the files. when trying to copy new files in their place it tells me that it's being used by another process. Next time MS asks me for money it will be used by another process

  • I still have such problem on winforms.

    Was searching for the solution, and found this page.

    Turninig off indexing of folder and event turninig off indexing service didn't help.

    VS 2005.

    I have to restart studion 7 times for a day. Why they don't have button "restart VS"?

    Does anybobody know the working solution?

  • I am getting similar problem with my program in C#.
    "The designer could not be shown for this file because none of the classes within it can be designed."

    It keeps saying that the base class for my usercontrol could not be loaded and to ensure that all the programs have been rebuilt.

    I have checked this a million times by now and still nada!!

    Please help.

  • Mine is Winforms VB.Net DotNet1.1 VSNet2003 WinXP SP3

    1) Close Solution
    2) Close the IDE
    3) Stopped Indexing
    4) Stopped Desktop Search (indexes as well)
    5) Stopped Anti-virus
    6) Deleted the bin and obj folders of the project giving the problem.
    7) Restarted Windows

    Login\IDE-vsnet2003\open-solution\rebuild-all => worked.

  • Pause de index service and anti-virus
    Rebuild -> OK!

Comments have been disabled for this content.