Corey Adler
Corey Adler

Reputation: 16137

TFS Build Issue with App.config file (Error 3719)

I'm currently in the process of moving my project code over to using the new Team Foundation Service. I'm trying to setup gated builds to run whenever I check in new code (and run the unit tests in the solution as well), but I keep getting the same error every time it builds in TFS.

Here's the error I keep getting: My MSBuild error

And here is the part of the diagnostic log that deals with this: Error Log

I've triple checked about that App.config file: It's in source control. Also, the project that fails is being built in other locations without any problems.

When I build in Visual Studio 2012 it works fine. When I build it using MSBuild from the command line it works fine. I've even installed Team Foundation Server 2012 on my local machine so that I could use the exact command line arguments that Team Foundation Service was using for MSBuild. That worked just fine.

If you need any more information I will be happy to provide it. Thanks in advance for all of your help.

EDIT: Here's a link to this question on the MSDN TFService forum, where there is also the full diagnostic log.

EDIT (12/12): When doing Ilya's suggestion (in his answer below), I get this from the log:

Larger log error

Upvotes: 2

Views: 2387

Answers (2)

Corey Adler
Corey Adler

Reputation: 16137

Ok, I've finally gotten this working. Huzzah!

Per the MSDN discussion in the link above, the app.config file for the DataLayerExtensions project was corrupted somehow. Deleting it from source control and then remaking the config file did the trick for that. It is important to note that that error in the picture up there from the 12/12 edit is not pointing at the DataLayer project! It is actually the first line of trying to build the DataLayerExtensions project after its dependencies (GlobalItems and DataLayer) were built! There is a little nuance there in the tabbing.

Subsequently, there were other app.config errors that occurred as well--all of which being because of not actually being in source control or of having the same corruption as the DataLayerExtensions config file.

One last point to mention is that apparently, for TFService, if you are using any 3rd-party tools, you will get errors in the build service, even if it builds fine on your local machine. In order to fix that I had to create a new folder, copied those 3rd-party assemblies into it, had all of the relevant projects switch their references to the .dll files in that folder, and proceeded to check it all in. Once that was done, the build completed successfully.

There is still an outstanding issue on the MSDN link as to why the Excel API was also being rejected like the 3rd-party tools were, but that is outside the scope of this question.

Upvotes: 1

Ilya Kozhevnikov
Ilya Kozhevnikov

Reputation: 10432

Try adding something like this to failing csproj and running it in the cloud, may be it'll give away why app.config is missing. May be some other custom event deletes/renames causing msbuild to fail?

<Target Name="AfterBuild">
  <Warning Text="### DEBUG ###" />
  <ItemGroup>
    <All Include="**\*.*" />
    <Compile>
      <Exists Condition="!Exists('%(Identity)')">FALSE</Exists>
    </Compile>
    <AppConfigWithTargetPath>
      <Exists Condition="!Exists('%(Identity)')">FALSE</Exists>
    </AppConfigWithTargetPath>
  </ItemGroup>
  <Warning Text="### All: %(All.Identity)" />
  <Warning Text="### Compile: %(Compile.Exist) # %(Compile.Identity)" />
  <Warning Text="### App: %(AppConfigWithTargetPath.Exist) # %(AppConfigWithTargetPath.Identity) # %(AppConfigWithTargetPath.FullPath)" />
</Target>    

Upvotes: 0

Related Questions