downloaded and expanded the .zip file - open VS2015 Community and select either of the solutions and click build and it errors with a 9009 error
With a lot of trial and error, I've been able to build...
/1/ Download and extract the solutions
/2/ Open CameraControlDevices.sln
* If you just Build the solution, it will fail with 8 errors in CameraControl.Devices.Example.
Instead, right click on CameraControl.Devices.Example in the Solution Explorere and choose properties. On the application group change the framework to .Net Framework 4.6 and click OK on the warning message.
NOW you can build the solution successfully.
/3/ Open CameraControl.sln
Before building, right click on CameraControl in the Solution Explorer, again choose properties and go down to the build events.
Change the Post-build event command line to include "s around the 1st two parameters, from
$(SolutionDir)PostBuild.Bat $(SolutionDir) $(ConfigurationName)
to
"$(SolutionDir)PostBuild.Bat" "$(SolutionDir)" $(ConfigurationName)
save, close the open window and build the solution.
You will get an error:
Severity Code Description Project File Line Source Suppression State Tool
Error The command "cd ..\..\
C:\Users\Burton\Documents\Visual Studio 2015\Projects\digiCamControl-master\Setup\bin\Debug\Setup.exe" exited with code 9009. Setup Build
This is because the Wix package is broken - it doesn't correctly look for the files in the directories. I spent a lot of time trying to fix it and gave up, just delete (remove) Setup from the solution.
If you rebuild at this point, you get a new error:
Severity Code Description Project File Line Source Suppression State Tool
Error The command ""C:\Users\Burton\Documents\Visual Studio 2015\Projects\digiCamControl-master\PostBuild.Bat" "C:\Users\Burton\Documents\Visual Studio 2015\Projects\digiCamControl-master\" Debug" exited with code 1. CameraControl Build
The output (log) has this:
13> A subdirectory or file C:\Users\Burton\Documents\Visual Studio 2015\Projects\digiCamControl-master\CameraControl\Bin\Debug\Plugins already exists.
13> The system cannot find the file specified.
13> The system cannot find the file specified.
13>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command ""C:\Users\Burton\Documents\Visual Studio 2015\Projects\digiCamControl-master\PostBuild.Bat" "C:\Users\Burton\Documents\Visual Studio 2015\Projects\digiCamControl-master\" Debug" exited with code 1.
14>------ Build started: Project: MtpTester, Configuration: Debug x86 ------
15>------ Build started: Project: PhotoBooth, Configuration: Debug x86 ------
This is because DccObs and MtpTester are not yet built when the PostBuild.bat file is executed as part of CameraControl but PostBuild.bat expects them, so these lines have errorlevel 1
copy %1MtpTester\Bin\%2\MtpTester.exe %1CameraControl\Bin\%2\ /Y
copy %1DccObsPlugin\Bin\%2\DccObsPlugin.dll %1CameraControl\Bin\%2\ObsPlugin\CLRHostPlugin\ /Y
You can fix PostBuild or better yet, manually build these two (ignoring the error) then build the entire solution. This gives the 'right' result:
13> A subdirectory or file C:\Users\Burton\Documents\Visual Studio 2015\Projects\digiCamControl-master\CameraControl\Bin\Debug\Plugins already exists.
13> 1 file(s) copied.
13> 1 file(s) copied.
So two warnings...
The items built after CameraControl are not updated in the CameraControl\Bin\Debug (or release) directory until the NEXT build
You don't have an installer and will have to manually copy the code
You should be able to fix this the 'right' way using Project | Project Dependencies, but I found I had to manually remove the reference to CameraControl within PhotoBooth before it would let me flip the dependencies (from MtpTester and PhotoBooth depending on CameraControl to CameraControl depending on MtpTester and PhotoBooth) and even then it didn't work.
I also created a new/improved version of PostBuild.bat, at least it won't blow up, but it still has the build order problem for the two folders copied in.
Code: Select all
REM %1 = Solution Directory
REM %2 = $(ConfigurationName) Debug/Release
echo.
echo PostBuild.bat running...
echo Solution directory..... %1
echo Configuration name..... %2
echo.
echo Copying updated additional Files from %1CameraControl.Application...
xcopy %1CameraControl.Application %1CameraControl\Bin\%2\ /Y /E /R /I /D
if [%errorlevel%] == [0] GOTO :CopyApplicationOK
echo.
echo Error copying application from %1CameraControl.Application to %1CameraControl\Bin\%2\
echo.
GOTO :end
:CopyApplicationOK
echo.
echo Copying additional Files from %1CameraControl.Application\*.*...
xcopy %1CameraControl.Application\*.* %1CameraControl\Bin\%2\ /Y
if [%errorlevel%] == [0] GOTO :CopyApplication2OK
echo.
echo Error copying application from %1CameraControl.Application\*.* %1CameraControl\Bin\%2\
echo.
GOTO :end
:CopyApplication2OK
IF NOT EXIST %1CameraControl\Bin\%2\Plugins (
echo.
echo Creating directory %1CameraControl\Bin\%2\Plugins
MD %1CameraControl\Bin\%2\Plugins
)
rem copy these if they exist...
echo.
echo checking %1MtpTester\Bin\%2\MtpTester.exe
IF EXIST %1MtpTester\Bin\%2\MtpTester.exe (
echo ...copying
copy %1MtpTester\Bin\%2\MtpTester.exe %1CameraControl\Bin\%2\ /Y
) else (
echo ...does not exist - skipping
)
echo.
echo checking %1DccObsPlugin\Bin\%2\DccObsPlugin.dll
IF EXIST %1DccObsPlugin\Bin\%2\DccObsPlugin.dll (
copy %1DccObsPlugin\Bin\%2\DccObsPlugin.dll %1CameraControl\Bin\%2\ObsPlugin\CLRHostPlugin\ /Y
echo ...copying
) else (
echo ...does not exist - skipping
)
:end
echo.
echo ... PostBuild done