none
MSB3061: Unable to delete file "bin\Debug\<<DLLName>>". Access to the path '<<ReferencePNE>>' is denied.

    Question

  • Hello...

    I'm having problems compiling my project in Visual Studio 2005.  After I compile the first time (after startup), I can't compile a second time because the DLL reference appears to be locked.  The reference in question is actually a PROJECT reference.  I have all references set to CopyLocal = False, but still have the error.  This project is still relatively simple... any thoughts?

    Here's the specific message: 

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(2313,9): error MSB3021: Unable to copy file "obj\Debug\BidManager.Data.dll" to "bin\Debug\BidManager.Data.dll". The process cannot access the file 'bin\Debug\BidManager.Data.dll' because it is being used by another process.

    Below, I pasted the entire build output.

    Andrew

    ------ Rebuild All started: Project: Utilities, Configuration: Debug Any CPU ------

    C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\LC.exe /target:BidManager.Utilities.dll /complist:"My Project\licenses.licx" /outdir:obj\Debug\ /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Shared.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.Misc.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinDock.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinEditors.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinGrid.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinMaskedEdit.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinToolbars.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinTree.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.v6.1.dll" /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.VisualBasic.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Design.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Runtime.Serialization.Formatters.Soap.dll

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc.exe /noconfig /baseaddress:11000000 /imports:Microsoft.VisualBasic,System,System.Collections,System.Data,System.Diagnostics,System.Drawing,System.Windows.Forms /nowarn:42016,42017,42018,42019,42032 /optioncompare:Binary /optionexplicit+ /optionstrict+ /removeintchecks- /rootnamespace:BidManager /doc:obj\Debug\BidManager.xml /define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /reference:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Shared.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.Misc.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinDock.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinEditors.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinGrid.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinMaskedEdit.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinToolbars.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinTree.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\windows forms\bin\Infragistics2.Win.v6.1.dll",C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.VisualBasic.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Design.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /main:"Synergis.(None)" /debug+ /debug:full /optimize- /out:obj\Debug\BidManager.Utilities.dll /resource:obj\Debug\BidManager.Common.Forms.ErrorBox.resources /resource:obj\Debug\BidManager.Utilities.dll.licenses /target:library /warnaserror- AssemblyInfo.vb Forms\ErrorBox.vb Modules\Constants.vb Modules\Enums.vb Modules\Exceptions.vb Modules\FileSystem.vb Modules\Forms.vb Objects\Microsoft.vb Modules\Reflection.vb Objects\MyRegistry.vb Modules\Strings.vb Objects\Tags.vb

    Utilities -> D:\Projects\Domus\BidManager\Utilities\bin\BidManager.Utilities.dll

    ------ Rebuild All started: Project: Data, Configuration: Debug Any CPU ------

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3061: Unable to delete file "bin\Debug\BidManager.Data.dll". Access to the path 'D:\Projects\Domus\BidManager\Data\bin\Debug\BidManager.Data.dll' is denied.

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 /rootnamespace:BidManager.Data /doc:obj\Debug\BidManager.xml /define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /reference:D:\Projects\Domus\BidManager\Utilities\bin\BidManager.Utilities.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /out:obj\Debug\BidManager.Data.dll /resource:obj\Debug\BidManager.Data.MaintenanceObjects.Company_Maintenance.resources /resource:obj\Debug\BidManager.Data.Resources.resources /target:library DataSets\DataCacheDS.Designer.vb DataSets\DataCacheDS.vb DataSets\ExplorerDS.Designer.vb DataSets\ExplorerDS.vb DataSets\PostalCodeLookupDS.Designer.vb DataSets\UserProfileDS.Designer.vb Exceptions\InvalidRequestCriteriaException.vb Exceptions\ServerTimeoutException.vb Exceptions\RecordDoesntExistException.vb "Maintenance Objects\Company_Maintenance.Designer.vb" "Maintenance Objects\Company_Maintenance.vb" Utilities\Data.vb Modules\Globals.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb" Utilities\Login.vb

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(2313,9): error MSB3021: Unable to copy file "obj\Debug\BidManager.Data.dll" to "bin\Debug\BidManager.Data.dll". The process cannot access the file 'bin\Debug\BidManager.Data.dll' because it is being used by another process.

    Done building project "Data.vbproj" -- FAILED.

    ------ Rebuild All started: Project: GUI, Configuration: Debug Any CPU ------

    C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\LC.exe /target:BidManager.GUI.exe /complist:"My Project\licenses.licx" /outdir:obj\Debug\ /i:D:\Projects\Domus\BidManager\Data\bin\Debug\BidManager.Data.dll /i:D:\Projects\Domus\BidManager\Utilities\bin\BidManager.Utilities.dll /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Shared.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.Misc.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinDock.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinEditors.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinExplorerBar.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinGrid.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinMaskedEdit.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinStatusBar.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinTabControl.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinToolbars.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinTree.v6.1.dll" /i:"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.v6.1.dll" /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Design.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Runtime.Serialization.Formatters.Soap.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /i:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.VisualBasic.dll

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Drawing,System.Diagnostics,System.Windows.Forms /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 /rootnamespace:BidManager.GUI /doc:obj\Debug\BidManager.xml /define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"WindowsForms\",PLATFORM=\"AnyCPU\"" /reference:D:\Projects\Domus\BidManager\Data\bin\Debug\BidManager.Data.dll,D:\Projects\Domus\BidManager\Utilities\bin\BidManager.Utilities.dll,"C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Shared.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.Misc.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinDock.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinEditors.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinExplorerBar.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinGrid.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinMaskedEdit.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinStatusBar.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinTabControl.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinToolbars.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.UltraWinTree.v6.1.dll","C:\Program Files\Infragistics\NetAdvantage 2006 Volume 1 CLR 2.0\Windows Forms\Bin\Infragistics2.Win.v6.1.dll",C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Design.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Runtime.Serialization.Formatters.Soap.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /main:BidManager.GUI.My.MyApplication /debug+ /debug:full /out:obj\Debug\BidManager.GUI.exe /resource:obj\Debug\BidManager.GUI.Forms.Explorer.resources /resource:obj\Debug\BidManager.GUI.Resources.resources /resource:obj\Debug\BidManager.GUI.Forms.FormBase.resources /resource:obj\Debug\BidManager.GUI.Forms.StandardWindow.resources /resource:obj\Debug\BidManager.GUI.Controls.Explore_Companies.resources /resource:obj\Debug\BidManager.GUI.Controls.Explore_CSICodes.resources /resource:obj\Debug\BidManager.GUI.Controls.Explore_PanelBase.resources /resource:obj\Debug\BidManager.GUI.Form1.resources /resource:obj\Debug\BidManager.GUI.PropGridForm.resources /resource:obj\Debug\BidManager.GUI.Forms.DataMaintenance.resources /resource:obj\Debug\BidManager.GUI.Company_Maintenance.resources /resource:obj\Debug\BidManager.GUI.Domus.ico /resource:obj\Debug\BidManager.GUI.exe.licenses /target:winexe /win32icon:Resources\Domus.ico ApplicationEvents.vb Forms\Explorer\Controls\Explore_Companies.Designer.vb Forms\Explorer\Controls\Explore_Companies.vb Forms\Explorer\Form\Form1.Designer.vb Forms\Explorer\Form\Form1.vb Forms\Explorer\Form\PropGridForm.Designer.vb Forms\Explorer\Form\PropGridForm.vb Forms\Base\DataMaintenance.Designer.vb Forms\Base\DataMaintenance.vb Forms\Maintenance\Company_Maintenance.Designer.vb Forms\Maintenance\Company_Maintenance.vb Modules\MyExtendedProperties.vb Forms\Base\FormBase.vb Forms\Base\StandardWindow.Designer.vb Forms\Base\StandardWindow.vb Forms\Explorer\Controls\Explore_PanelBase.Designer.vb Forms\Explorer\Controls\Explore_PanelBase.vb Forms\Explorer\Form\Explorer.Designer.vb Forms\Explorer\Form\Explorer.vb Forms\Explorer\Controls\Explore_CSICodes.Designer.vb Forms\Explorer\Controls\Explore_CSICodes.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb" Settings.vb

    GUI -> D:\Projects\Domus\BidManager\GUI\bin\Debug\BidManager.GUI.exe

    ========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========

     

    Wednesday, August 16, 2006 7:06 PM

Answers

  • It's probably caused by a bug in us.

    Try this:

    Edit your project file and add this to the first PropertyGroup:

       <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

    Specifically, you only need to add it to the project that contains the .resx file that contains a serialized instance of a type that's in the assembly that you're seeing locked. But it's fine if you add it to any projects. It makes the build a little slower, that's all.

    Let us know if that works.

    We're planning on fixing this bug for the next version, obviously. Sorry for the inconvenience Hauchmahler.

    Dan

    "This posting provided AS-IS with no warranties"

    Thursday, August 24, 2006 3:20 PM

All replies

  • One thing that may help fix your problem is to turn off the Windows Indexing service and any virus scanner you have running before doing the build. In the past i have found both of these will intefere occassionly and somewhat randomly, they detect that a file has just been created or moved and they quickly grab a hold of it to do their thing, but they can also frequently lock the file up for a period after they have finished with it.

    This may not fix your problem totally though. Another thing you could do is go to the Sysinternals site, they have a tool for determining what process is holding a lock on a file, and you can use that to track down what is locking it.

     

    Thursday, August 17, 2006 1:34 AM
  • Hey... Thanks for your suggestion. 

    I shut of SpywareDr and Avast Antivirus... and verified that the Windows Indexing service was not running.  Still same issue.

    Then, I downloaded FileMon.ext from Sysinternals as you suggested.  Great site, btw... my first visit. - thanks!  In all cases, the only process that accesses the file(s) in question is the development environment. 

    I work on two machines... my desktop and my laptop, and the laptop was due for an overhaul... so I decided to wait to see if compiling on a 'fresh' machine/install would change anything (both machines are configured identically in terms of software).  Unfortunately, it didn't.

    Again, thanks for your tips.  It *appears* to be an issue with the development environment and/or my configuration (which is essentialy 'otb').  I'm trying to think about where to look next...


    Saturday, August 19, 2006 9:50 PM
  • It's probably caused by a bug in us.

    Try this:

    Edit your project file and add this to the first PropertyGroup:

       <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

    Specifically, you only need to add it to the project that contains the .resx file that contains a serialized instance of a type that's in the assembly that you're seeing locked. But it's fine if you add it to any projects. It makes the build a little slower, that's all.

    Let us know if that works.

    We're planning on fixing this bug for the next version, obviously. Sorry for the inconvenience Hauchmahler.

    Dan

    "This posting provided AS-IS with no warranties"

    Thursday, August 24, 2006 3:20 PM
  • Dan,

    Thanks... that seems to have worked.  I've rebuilt and run my solution several times in a row now without having to close VS in between due to failures.  So far so good...  You're my new personal hero.  The issue really had me frustrated and was costing me a lot of development time.

    Best,

    Andrew
    Thursday, August 24, 2006 4:49 PM
  • I just tried this... It didn't work.  I tried opening the project file in the Visual Studio editor and it's indicating that the tag is an invalid child element.  If I change the xmlns setting the editor does not flag this tag as a problem, but of course I can't open the project either.

    Any suggestions?

    Also, if you have any information about the cause of this problem, I'd be very interested.  I've been working on this project for two months and did not have this problem until today.  I'm not sure what changed. 

    I'm running both VS 2003 and VS 2005 on this computer.  This is a VS 2005 project.

     

    Friday, August 25, 2006 8:07 PM
  • I'm not sure if this is helpful, khy, but here's what the first portion of my PROJECT file looks like...

    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{0ACCB354-5358-4B4C-B9A8-5052716A1FE0}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <StartupObject>BidManager.GUI.My.MyApplication</StartupObject>
    <RootNamespace>BidManager.GUI</RootNamespace>
    <AssemblyName>BidManager.GUI</AssemblyName>
    <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>
    <MyType>WindowsForms</MyType>
    <ApplicationIcon>Resources\Domus.ico</ApplicationIcon>
    <OptionStrict>On</OptionStrict>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>BidManager.xml</DocumentationFile>
    <NoWarn>
    </NoWarn>
    <WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
    </PropertyGroup>

    There are actually three PROJECTS in the Solution... I added that highlighted node to each.

    Hope that helps...

    Friday, August 25, 2006 8:26 PM
  • OK...  Found the problem.  It looks like you have to add this line to any project in the solution that references the offending project.  In other words, if Project A and Project B reference Project C (and Project C is the offending project), it appears that you have to add this to this tag to Project A, B, & C so that the project can build.

    Also, any idea on the cause of this problem?  Like I said, this worked fine until this morning... 

    Friday, August 25, 2006 8:59 PM
  • Excellent, I'm glad that helped.  Yes... every 'offending' project.  In my case... I just put it in each to be on the safe side.

    I had the problem from the beginning, and I too have no idea why.  VS2005 has been a wonderful upgrade in terms of features, but I've found it incredibly buggy/tempermental and slow.
    Friday, August 25, 2006 9:07 PM
  • This solution did not work for me. Although I added the "GenerateResourceNeverLockTypeAssemblies" tag in the proper "PropertyGroup" of all projects.
    Monday, August 28, 2006 9:00 PM
  • Has this problem been solved yet. I used the suggestion provided and included the tag in all my project files and still have a problem. I'm going to go insane if I have to split my projects out into separate solutions just to avoid this problem.

    I see this thread was started back in August 2006. I am hoping further suggestions are available.

    (And I did turn off file indexing for my development directories).

    Thanks in advance for any available insights.

    Monday, January 29, 2007 6:17 PM
  • I haven't had any problems since.  If you haven't upgraded to SP1 yet, that may help.  I've noticed an overall stability improvement.
    Monday, January 29, 2007 7:01 PM
  • Nope, this workaround doesn't work for me either, I have 4 projects in my solution, a bunch of Custom Web Controls in one of them. Here's an example of one of the edited project files (added the line to the first PropertyGroup as suggesteted):

    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
    <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProductVersion>8.0.50727</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{B08C1C0F-E67A-4A2D-A8E4-BB6268B81786}</ProjectGuid>
        <OutputType>Library</OutputType>
        <AppDesignerFolder>Properties</AppDesignerFolder>

    ....

    This has become a serious problem as the project has grown larger than a trivial example. I'm nowhere near finished yet VS2005 is now virtually unusable.

    Not even cleaning/rebuilding the entire project works 100% of the time.

    Is there not to be a hotfix for this sooner rather than later?

    Wednesday, March 07, 2007 11:42 AM
  • Hi,

    Just to add to the confusion. I had this start on me in the last week. The solution has 8 projects in it. After applying the fix above the problem seems to be resolved. Maybe the location in the vbproj file matters. This solution existed for more than a year before the problem began.  I noticed it started sometime after I installed SP1 so that does not fix the problem.

    I wish I knew why this was happening. MSFT, can you help us understand? Can you tell us when we can expect a fix?

    Thanks,

    \ ^ / i l l 

    Wednesday, March 14, 2007 10:11 PM
  • Hi,

     

    Try deleting the files in the obj and bin directory outside VS in all project's within your solution after that a build/rebuild is no issue. I didn't use the tag

     

    <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

     

    Greets,

     

    Tom

     

    Monday, June 04, 2007 3:13 PM
  • I have the same problem. Adding the tag in project file did not solve the problem. Any update

    to this issue? My problem is that I only get waring of "Warning 1 Unable to delete file "bin\Debug\CommonClasses.dll". Access to the path 'C:\Vol2\Everest\Aud-Team\ESS\ESSConsole\bin\Debug\CommonClasses.dll' is denied."

    The app build went through but it runs extremly slow. This is only happened after I upgrade the new commonclasses.

    Any idea? Thanks,


     

     

    Tuesday, September 25, 2007 5:03 PM
  • Did anyone actually check to see if the file in question was actually locked.  I had a very similar problem and found that my .dll and .pdb files had somehow been checked into Visual Source Safe (VSS), which in fact had locked both files.  I did have to manually delete them from the bin directory which also asked if I wanted to delete them from VSS, and I of course replied "YES".  This solved the problem.  I also did not use the tag:

     

    <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

     

     

    • Proposed as answer by VictorJuri Saturday, January 16, 2010 12:33 AM
    Tuesday, March 04, 2008 6:59 PM
  • Something else to think about...  None of the solutions above worked for me.  Why?

     

    McAfee Enterprise 8.5.0i with Access Protection.  In the VirusScan Console \ Access Protection theres a Category called Common Maximum Protection which has a block for "Prevent creation of new executable files in the Program Files directory."

     

    This prevented my executable / assemblies from being created.  Which also exposes a flow in my process <grin> --why am I deploying directly to the Program Files folder...  that's a whole different story...

     

    But hopefully this helps someone--in short, maybe your antivirus or file protection software is blocking creation (same symptoms as locking).

     

    Monday, March 17, 2008 7:33 PM
  • Here's something that worked for me.   Remove the the indexing service from the folders where the files are getting locked.  In my case, files from the bin & obj folders of a certain project were getting locked.  So I went to C:\Dev\SolutionName\ProjectName\bin and C:\Dev\SolutionName\ProjectName\obj.  Right-click on the folder and go to Properties.  Click on the "Advanced" button.  

    Uncheck the box for "For fast searching, allow Indexing Service to index this folder".  Click "OK" button.  If a message appears, select "Apply changes to this folder, subfolders and files" and click "OK" button.  Rebuild your solution.  Good luck.

    Wednesday, December 03, 2008 4:31 PM
  • Build solution for:

    "Unable to copy file The process cannot access the file because it is being used by another process"

     

    Place in pre build event of project:

     

    if exist "$(TargetPath)"*".locked" del "$(TargetPath)"*".locked"
    if exist "$(TargetPath)" move "$(TargetPath)" "$(TargetPath)."%date:~4,2%%date:~7,2%%date:~10,4%_@_%time:~0,2%h%time:~3,2%m%time:~6,2%s%.locked

    • Proposed as answer by daniel911 Saturday, June 05, 2010 10:11 AM
    Wednesday, September 30, 2009 7:47 PM
  • Thanks Peaches June. I deleted my DLL & PDB files which had indeed been checked in to source control. Re built and done! Project loaded perfectly.
    Saturday, January 16, 2010 12:35 AM
  • I spent 2 hours trying to solve this problem.  I even stopped and disabled the indexing service and anti-virus, and still had a problem.  However, when I right clicked the folder and disallowed Indexing Service to index this folder my problem went away.

     

    Scratch that; my problem reappeared again

    Thursday, April 07, 2011 9:33 PM
  • For me, I just turn off any IE process (iexplore.exe) using task manager.

    I hope it can be useful for you all.

    Tuesday, September 13, 2011 12:24 PM
  • Hello...Running the program as an Administrator on Windows 7 cleared up the problem for me.  You can set the program to always run as an administrator by right-clicking the shortcut.  Visit this link for instructions:

    http://blogs.vertigo.com/personal/jeffv/Blog/Lists/Posts/Post.aspx?ID=4

    • Proposed as answer by JassenT Sunday, December 11, 2011 2:39 PM
    Sunday, December 11, 2011 2:38 PM
  • DanMoseley -- Regarding this "We're planning on fixing this bug for the next version"  do you know if they every got around to the fix, because it still seems to happen in VS 2013 today. and adding the GenerateResourceNeverLockTypeAssemblies node does not seem to fix it BUT closing and restarting Visual Studio does seem to workaround it. Do you have any news on this? Another fix perhaps? Just curious. It could be something else in my case, I admit, but it is suspiciously similar-- locking only on the one project that has a Resource file in it, etc. Anyway and regardless, Visual Studio truly is a great product as-is IMHO so I am just asking here and not intending to bash at all. Thanks. -- Mark Kamoski 


    -- Mark Kamoski

    Wednesday, November 06, 2013 8:44 PM