5

My TeamCity build fails because I have a project that has 2 EF Code Migration configurations in it.

From the build log:

[12:39:58]Checking for changes
[12:39:58]Collecting changes in 1 VCS root (1s)
[12:40:00]Clearing temporary directory: C:\TeamCity\buildAgent2\temp\buildTmp
[12:40:00]Publishing internal artifacts
[12:40:00]Checkout directory: C:\TeamCity\buildAgent2\work\1679b8b30e00ad0
[12:40:00]Updating sources: server side checkout (2s)
[12:40:03]Step 1/8: Gulp (Command Line)
[12:40:03]Step 2/8: Nuget Package Refresh (NuGet Installer) (3s)
[12:40:06]Step 3/8: Compile (MSBuild) (21s)
[12:40:27]Step 4/8: Unit Tests (NUnit) (33s)
[12:41:01]Step 5/8: Transform Files (Powershell) (2s)
[12:41:03]Step 6/8: Deployment Build on XXXXX Live (MSBuild) (25s)
[12:41:29]Step 7/8: Deploy Database (Powershell) (5s)
[12:41:34]Step 8/8: Deploy Portal.Hub (Powershell) (33s)
[12:42:08]Publishing artifacts
[12:42:08][Publishing artifacts] Collecting files to publish:     [C:\TeamCity\buildAgent2\temp\buildTmp\nuget5954880593924726328packages\nuget.xml => .teamcity/nuget]
[12:42:08][Publishing artifacts] Publishing using [WebPublisher]
[12:42:08][Publishing artifacts] Publishing using [ArtifactsCachePublisher]
[12:42:08][Publishing artifacts] Artifacts path 'C:/TeamCity/buildAgent2/temp/buildTmp/nuget5954880593924726328packages/nuget.xml' not found
[12:42:08]Reverting patched assembly versions
[12:42:08][Reverting patched assembly versions] Restoring C:\TeamCity\buildAgent2\work\1679b8b30e00ad0\src\Portal.Api\Properties\AssemblyInfo.cs
[12:42:08][Reverting patched assembly versions] Restoring C:\TeamCity\buildAgent2\work\1679b8b30e00ad0\src\Portal.Common\Properties\AssemblyInfo.cs
[12:42:08][Reverting patched assembly versions] Restoring C:\TeamCity\buildAgent2\work\1679b8b30e00ad0\src\Portal.Data\Properties\AssemblyInfo.cs
[12:42:08][Reverting patched assembly versions] Restoring C:\TeamCity\buildAgent2\work\1679b8b30e00ad0\src\Portal.Hub\Properties\AssemblyInfo.cs
[12:42:08][Reverting patched assembly versions] Restoring C:\TeamCity\buildAgent2\work\1679b8b30e00ad0\src\Portal.Manager\Properties\AssemblyInfo.cs
[12:42:08][Reverting patched assembly versions] Restoring C:\TeamCity\buildAgent2\work\1679b8b30e00ad0\src\Portal.Managers\Properties\AssemblyInfo.cs
[12:42:08][Reverting patched assembly versions] Restoring C:\TeamCity\buildAgent2\work\1679b8b30e00ad0\src\Portal.SignalR\Properties\AssemblyInfo.cs
[12:42:08][Reverting patched assembly versions] Restoring C:\TeamCity\buildAgent2\work\1679b8b30e00ad0\src\Portal.Tests\Properties\AssemblyInfo.cs
[12:42:08]Publishing internal artifacts
[12:42:08][Publishing internal artifacts] Sending using WebPublisher
[12:42:08][Publishing internal artifacts] Sending using ArtifactsCachePublisher
[12:42:08]Build failure condition: There was an error reported in one of the build steps.
[12:42:08]Build failure condition cause message: ERROR: More than one migrations configuration type was found in the assembly 'Portal.Data'. Specify the name of the one to use. (show original message)
[12:42:08]Build finished

Note: the only red (failures) are the last two lines above "Build Finished"

I am not running the migrations and I can't see any steps in team city or the publish profile that would be attempting to do this.

I do not want to split my configurations into separate projects, I just want to stop TeamCity from attempting to run them.

My Build Steps are:

1/8 Gulp - minimize js files

2/8 NuGet Installer - update nuget references in the solution

3/8 MSBuild - .NET 4.5 x86 compile

4/8 NUnit - run unit tests

5/8 Powershell - run script to manipulate app.config files for the windows service

6/8 MSBuild - use publish profile to deploy website

7/8 Powershell - script to deploy database

8/8 Powershell - script to deploy windows service

The publish profile: validation connection button works OK on the connection tab, on the settings page there are several databases listed but none have connection strings or "use this connection string at runtime" checked. One of them has an info label next to it "In order to publish a Code First Model, Code First Migrations should be used".

We have virtually identical build configurations for other projects which work fine.

Thanks

SturmUndDrang
  • 1,876
  • 5
  • 27
  • 47
  • Can you provide more detail as to what is going on in your build steps and the publish profile. Are there any Pre / Post build events in your .csproj files. Can you show the original exception stack from the TeamCity build log? – Matt Jun 01 '15 at 16:08
  • There are no are build events in the proj file. There is no stack trace from TeamCity - all the build steps work and the above is output at the bottom. I'll update the question with more info on the build steps – SturmUndDrang Jun 02 '15 at 14:48
  • Can you tell me which build step is generating the error? If all of your build steps are completing successfully then something's not configured correctly. Can you elaborate on the custom powershell steps? This is a bit like a needle in a haystack at the moment - unless I can understand exactly what is being executed I don't think I can offer you any value. e.g. does the Deploy windows service install it and start it? – Matt Jun 02 '15 at 18:58
  • If all steps pass, but there's a custom failure condition on the build configuration, can you show the verbose output for the build step that generates that output "ERROR" (I'm assuming you've shown the minimal detail to hide any sensitive details) – Matt Jun 02 '15 at 19:07
  • I've put the full buildlog here http://dropcanvas.com/aqqh3 - I can't see any failures. – SturmUndDrang Jun 03 '15 at 10:54

1 Answers1

2

From the logs, it does appear as though you are trying to apply the EF migrations in Step 7 - Deploy Database Step.

Highlight

This is where the config exception is getting thrown.

If the goal is to stop TeamCity from running them then disabling the step would do that.

Hope this helps

Matt
  • 3,684
  • 1
  • 17
  • 19