The ActiveGantt demo project is generating errors when being built
Details
Date:5/1/2013 12:50:01 AM
Product:ActiveGanttVBW Gantt Chart / Scheduler Component
Framework:.Net Framework 4.5 / Visual Studio 2012 - 2013
Version:2.9.8
User's Development Environment:Visual Basic .Net 2010
Subject:Error MSB3021 is being generated when trying to build the demo application for ActiveGanttVBW
Question

This error:

error MSB3021: Unable to copy file "obj\Debug\AGVBWCON.exe" to "bin\AGVBWCON.exe". The process cannot access the file 'bin\AGVBWCON.exe' because it is being used by another process.

Is being generated when trying to build the demo project for ActiveGanttVBW.

Answer

Answer:

This is a long running (more than 5 years) Visual Studio bug that Microsoft has not corrected. A discussion of this issue can be found here.

This problem is only being generated when the WPF designer is opened. This issue also affects ActiveGanttCSW.

The workaround is to include this code:


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

In the pre-build event command line.

The pre-build command line can be located by right clicking on AGVBWCON in solution explorer, right clicking on properties, selecting the compile tab and clicking on the build events button.

You can read the whole article by Keyvan Nayyeri here.

Even when the workaround has been implemented if you try to start the demo application when the designer is open, the Microsoft Visual Studio XAML UI Designer will prevent the program from running.

Right click on the Microsoft Visual Studio XAML UI Designer icon in the Taskbar (on the left or on the right of Visual Studio 2012 and select the Close Window option. The demo will then execute.

If Visual Studio 2012 is frozen, open the desktop. You can do this by clicking on the right side of the task bar, lower right hand side of the screen.

 

All trademarks are property of their respective holders, and are only used to directly describe the products and services being provided. Their use in no way indicates any relationship or endorsement between The Source Code Store LLC and the holders of said trademarks.