Discussed [here](https://msbuildextensionpack.codeplex.com/discussions/470626)
__I have a build script that works fine on local developer machines but throws the exception below when I execute the command on a TeamCity build server.
The command in the db.targets that's failing is:__
<ItemGroup>
<RebuildSqlScripts Include="$(RebuildDirectory)\*.sql"/>
</ItemGroup>
<Message Condition ="'%(RebuildSqlScripts.Filename)' != ''" Text="Executing SQL Scripts in $(RebuildDirectory) on $(DatabaseName): "/>
<!--<Message Text="SQL Script Files: @(RebuildSqlScripts)"/>-->
<MSBuild.ExtensionPack.SqlServer.SqlCmd Condition ="'%(RebuildSqlScripts.Filename)' != ''" TaskAction="Execute" LogExceptionStack="true" Server="$(SqlServerName)" Database="$(DatabaseName)" LogOn="$(User)" Password="$(Password)" InputFiles="%(RebuildSqlScripts.Identity)" Variables="@(DatabaseVariables)" />
__The exception:__
[MSBuild.ExtensionPack.SqlServer.SqlCmd] C:\BuildAgent1\work\700df50f30b3154c\build\Database\Common\db.targets(97, 3): InvalidOperationException: No process is associated with this object.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_HasExited()
at MSBuild.ExtensionPack.SqlServer.Extended.SqlCmdWrapper.Execute() in C:\Projects\CodePlex\MSBuildExtensionPack\Solutions\Main\Framework\SqlServer\SqlCmdWrapper.cs:line 105
at MSBuild.ExtensionPack.SqlServer.SqlCmd.ExecuteCommand(String arguments) in C:\Projects\CodePlex\MSBuildExtensionPack\Solutions\Main\Framework\SqlServer\SqlCmd.cs:line 480
at MSBuild.ExtensionPack.SqlServer.SqlCmd.SqlExecute() in C:\Projects\CodePlex\MSBuildExtensionPack\Solutions\Main\Framework\SqlServer\SqlCmd.cs:line 559
at MSBuild.ExtensionPack.BaseTask.Execute() in C:\Projects\CodePlex\MSBuildExtensionPack\Solutions\Main\Common\BaseTask.cs:line 85
__
Any idea what the error actually means? I looks like the underlying exception is being suppressed...
__
__I have a build script that works fine on local developer machines but throws the exception below when I execute the command on a TeamCity build server.
The command in the db.targets that's failing is:__
<ItemGroup>
<RebuildSqlScripts Include="$(RebuildDirectory)\*.sql"/>
</ItemGroup>
<Message Condition ="'%(RebuildSqlScripts.Filename)' != ''" Text="Executing SQL Scripts in $(RebuildDirectory) on $(DatabaseName): "/>
<!--<Message Text="SQL Script Files: @(RebuildSqlScripts)"/>-->
<MSBuild.ExtensionPack.SqlServer.SqlCmd Condition ="'%(RebuildSqlScripts.Filename)' != ''" TaskAction="Execute" LogExceptionStack="true" Server="$(SqlServerName)" Database="$(DatabaseName)" LogOn="$(User)" Password="$(Password)" InputFiles="%(RebuildSqlScripts.Identity)" Variables="@(DatabaseVariables)" />
__The exception:__
[MSBuild.ExtensionPack.SqlServer.SqlCmd] C:\BuildAgent1\work\700df50f30b3154c\build\Database\Common\db.targets(97, 3): InvalidOperationException: No process is associated with this object.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_HasExited()
at MSBuild.ExtensionPack.SqlServer.Extended.SqlCmdWrapper.Execute() in C:\Projects\CodePlex\MSBuildExtensionPack\Solutions\Main\Framework\SqlServer\SqlCmdWrapper.cs:line 105
at MSBuild.ExtensionPack.SqlServer.SqlCmd.ExecuteCommand(String arguments) in C:\Projects\CodePlex\MSBuildExtensionPack\Solutions\Main\Framework\SqlServer\SqlCmd.cs:line 480
at MSBuild.ExtensionPack.SqlServer.SqlCmd.SqlExecute() in C:\Projects\CodePlex\MSBuildExtensionPack\Solutions\Main\Framework\SqlServer\SqlCmd.cs:line 559
at MSBuild.ExtensionPack.BaseTask.Execute() in C:\Projects\CodePlex\MSBuildExtensionPack\Solutions\Main\Common\BaseTask.cs:line 85
__
Any idea what the error actually means? I looks like the underlying exception is being suppressed...
__