Ben Salins

I'am trying to create installables ( MSI & Setup.exe) via a .VDPROJ in TFSBUILD. As we know, TFSBUILD doesn't recognise the .VDPROJ files, so therefore i've to execute it via a task in the AFTERCOMPILE target. I've explained my problem below, It would be really helpful if you could give me a clue as to where I'am going wrong !!

Regard,

Ben Salins.

The TFSBUILD.Proj has the following code

<Target Name="AfterCompile">

<Exec Command="&quot;c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv&quot; &quot;C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsService.sln&quot; /Build &quot;Release|Any CPU&quot; /Project &quot;C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsServiceInstaller\MS.CP.WindowsServiceInstaller.vdproj&quot;"/>

<Copy SourceFiles="$(SolutionRoot)\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsServiceInstaller\Release\MS.CP.WindowsServiceInstaller.msi"

DestinationFolder="C:\pr\cp3\DropBits" />

<Copy SourceFiles="$(SolutionRoot)\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsServiceInstaller\Release\setup.exe"

DestinationFolder="C:\pr\cp3\DropBits" />

</Target>

Error Message

error MSB3073: The command ""c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv" "C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsService.sln" /Build "Release|Any CPU" /Project "C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsServiceInstaller\MS.CP.WindowsServiceInstaller.vdproj"" exited with code 1.

Turn of Events

1) Before executing the team build I specificaaly delete MSI and SETUP.exe from the following location C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsServiceInstaller\Release. As not deleting these files cause a different error.

2) When the TFSBUILD.ProjBuild is executed a messagebox is displayed on the server where the TFSBUILD services is running. The Message in the MessageBox is as follows.

C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\TeamBuildTypes refers to a location that is unavailable. It could be on a hard drive on this computer, or on a network. Check to make sure that the disk is properly insertes, or that you are connected to the internet ot you network, and then try again. Is it still cannot be located, the information might have been moved to a different location.

3) The MSI and SETUP.exe files are then created in the following folder C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsServiceInstaller\Release

4) The Build then fails and the Error Message shown above is displayed.

SUPRISE

On executing the "c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv" "C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsService.sln" /Build "Release|Any CPU" /Project "C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsServiceInstaller\MS.CP.WindowsServiceInstaller.vdproj" from the command prompt the build is successful.



Re: Team Foundation Server - Build Automation TFBUILD failed with error MSB3073 and exited with code 1

Jason Pricket - MSFT

Hi Ben,

I am not sure how the two error messages above are related, so let's address error number one (exit code 1).

My guess is that the user account that the Team Build service is running as does not have the right permissions to one of the directories. Have you tried logging in as that account and running the command from the command line Perhaps that would give you a better error message.

The second error message seems to be related to some path being set incorrectly. I am not sure what would cause a dialog box to pop up. See if you can find out which variable contains that path (hopefully its in the log file). Then you can trace back to where the variable gets set (that's probably the problem area) and where it gets used (that will point out the thing that is causing the pop up dialog).

Good Luck,

Jason





Re: Team Foundation Server - Build Automation TFBUILD failed with error MSB3073 and exited with code 1

Ben Salins

Jason,

I've tried the first suggestion, the build still fails with CODE 1.

I added the following code in the TFSBUILD.RSP file, this helps me get more detail in the log file.

TFSBUILD.RSP

/v:diagnostic

One of the entries in the log file is

ERROR: Could not delete the previously built file 'C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\MS.CP.WindowsServiceInstaller\Release\MS.CP.WindowsServiceInstaller.msi'. 'Access is denied.'

I' ve taken the following precautions while before executing the build

1) The MSI and EXE files were physically deleted before deleting the file.

2) The service account under which the TFS BUILD SERVICE is running, say User1, The build is executed from the same user credentials i.e. USER1 through the VS IDE.

3) USER1 has full control over the physical directory in question i.e C:\PR\CP3......., this has been done via the Security Tab of the Folder Property Page.

4) The Folder C:\PR\CP3.... resets itself to read-only despite changing the attribute to write.

Regarding, the error message in the Message box, I did the following and it doesn't seem to appear now.

1) Made the following changes in the WORKSPACEMAPPING.XML

Code Snippet

<Mappings>

<InternalMapping ServerItem="$/BizOps/CP/Release 2.0/Source/Assemblies/MS.CP.WindowsService" LocalItem="D:\TKBGITVSTFAT10\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService" Type="Map" />

</< FONT>Mappings>

2 Made the following changes in TFSBUILD.Proj

Code Snippet

<!--

<SolutionToBuild Include="$(SolutionRoot)\CP\Release 2.0\Source\Assemblies\MS.CP.WindowsService\MS.CP.WindowsService.sln" />

-->

<SolutionToBuild Include="$(SolutionRoot)\MS.CP.WindowsService.sln" />

.

.

.

.

<Target Name="AfterCompile">

<Exec Command="&quot;c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv&quot; &quot;C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\MS.CP.WindowsService.sln&quot; /Build &quot;Release|Any CPU&quot; /Project &quot;C:\pr\cp3\BizOps\Daily-Build-v1.0\Sources\MS.CP.WindowsServiceInstaller\MS.CP.WindowsServiceInstaller.vdproj&quot;"/>

</Target>

It would be really great if you could throw some ideas at me. I'am really struggling for the past four days to resolve this problem.

Thanks,

Ben Salins





Re: Team Foundation Server - Build Automation TFBUILD failed with error MSB3073 and exited with code 1

Jason Pricket - MSFT

I think you misunderstood me on my first suggestion. Here is what I would do first:

1) log on to the build machine as the build service account

2) open the log file and copy the command that returned error code 1

3) open a command prompt and past in the command

If the command works in this case but not inside MSBuild, something really strange is happening. Perhaps this project is being built twice Let me know how the above works.

Jason





Re: Team Foundation Server - Build Automation TFBUILD failed with error MSB3073 and exited with code 1

Ben Salins

JASON,

Thanks for you help, I tried what you said earlier, about logging in using the service account and executing the build via the command, the build was successful. but it wasn't successful via MSBUILD.

I' ve rectified the problem, with the help of a friend of course, there was a problem with the path for the exec command.

The curent working code is

Code Snippet

<Exec Command="&quot;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv&quot; &quot;$(SolutionRoot)\MS.CP.WindowsService\MS.CP.WindowsServiceInstaller\MS.CP.WindowsServiceInstaller.vdproj&quot; /REBuild"/>

Thanks,

Ben Salins





Re: Team Foundation Server - Build Automation TFBUILD failed with error MSB3073 and exited with code 1

Jason Pricket - MSFT

Hi Ben,

Glad to hear you fixed the issue! And thanks for posting your solution. It may help someone else out there.

Thanks,

Jason