InvalidOperationException: Cannot dispose the build manager
The project compiles ( According to the Activity log of the TFS Build Agent) but then the part where SA should come in fails. First I tried the first article and after getting the same error as this one pasted below I tried the original article from Red-Gate.
I made it so but still the same error. I tried several combinations but the error stays the same. The current state of (the end) of my .csproj is :
<PropertyGroup Condition="'$(TfsBuild)' == 'True' and '$(RunSmartAssembly)' == 'True' "> <SmartAssemblyConfigurationFileRelativePath Condition="'$(SmartAssemblyConfigurationFileRelativePath)' == ''">$(ProjectName).saproj</SmartAssemblyConfigurationFileRelativePath> </PropertyGroup> <UsingTask TaskName="SmartAssembly.MSBuild.Tasks.Build" AssemblyName="SmartAssembly.MSBuild.Tasks, Version=22.214.171.124, Culture=neutral, PublicKeyToken=7f465a1c156d4d57" /> <Target Name="AfterBuild" Condition="'$(TfsBuild)' == 'True' and '$(RunSmartAssembly)' == 'True'"> <SmartAssembly.MSBuild.Tasks.Build ProjectFile="$(SmartAssemblyConfigurationFileRelativePath)" Input="@(MainAssembly)" OverwriteAssembly="True" /> </Target>
but there is no difference - still the same error. I have set up SA only for Feature Usage and Error reporting. I have already ran SA Pro through its interface on the Build Agent machine and it works perfectly.
That brings me to the conclusion that I am doing it wrong in the csproj file.
This is the error TFS displays ( web access or VS 2012 - the same) and I can not possibly know what is happening - it is rather vague. I tried to google for this error but the only thing I found was multiple processor building errors - I did not enable any multi processor build. I looked at BuildAgent Activity log but still no clue.
Unhandled Exception: System.InvalidOperationException: Cannot dispose the build manager because it is not idle. at Microsoft.Build.Execution.BuildManager.Dispose(Boolean disposing) at Microsoft.Build.Execution.BuildManager.Dispose() at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String targets, String toolsVersion, Dictionary`2 globalProperties, ILogger loggers, LoggerVerbosity verbosity, DistributedLoggerRecord distributedLoggerRecords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean debugger, Boolean detailedSummary) at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine) at Microsoft.Build.CommandLine.MSBuildApp.Main() Exception Message: MSBuild error 255 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Did I mess the csproj? There should be some misconfiguration between TFS Build and SA. Any clue what is going on?