serving the solutions day and night

Pages

Monday, August 12, 2013

File Lock Error In Visual Studio

Your project dll is referenced by another project, when you trying to build a project, you will get file lock issue in visual studio,

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




if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"

if exist "$(ProjectDir)bin\$(TargetFileName).locked" del "$(ProjectDir)bin\$(TargetFileName).locked"
if exist "$(ProjectDir)bin\$(TargetFileName)" if not exist "$(ProjectDir)bin\$(TargetFileName).locked" move "$(ProjectDir)bin\$(TargetFileName)" "$(ProjectDir)bin\$(TargetFileName).locked"

Register dll in 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL'
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\GacUtil.exe" /i "$(TargetPath)" /f

No comments: