Failure removing assembly from cache: The parameter is incorrect.

Topics: Server Deployment
Jun 12, 2014 at 11:17 AM
I'm getting below error while undeploying the solutions Any idea ?

Biztalk2010 and BTDF 5.0

I have deployed/undeployed other applications, there I'm not getting any error,except this one. As per error, where it is unable to find the orchestration assembly? It is on development server.


Target UndeployOrchestrations:
            "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\gacutil.exe" /u ""
            Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.1
            Copyright (c) Microsoft Corporation.  All rights reserved.

            Failure removing assembly from cache:   The parameter is incorrect.

            C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\BizTalkDeploymentFramework.targets(1265,5): error MSB3073: The command ""C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\gacutil.exe" /u """ exited with code 1.
        Done building target "UndeployOrchestrations" in project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.
    Done building target "UndeployBizTalkMgmtDB_true" in project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.
Done building target "ServerUndeploy" in project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.
Done building target "Undeploy" in project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.

Done building project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.

Build FAILED.

C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\BizTalkDeploymentFramework.targets(1265,5): error MSB3073: The command ""C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\gacutil.exe" /u """ exited with code 1.
0 Warning(s)
1 Error(s)
Coordinator
Jun 12, 2014 at 2:43 PM
The assembly name is an empty string, so there's probably something wrong in your Orchestrations ItemGroup, or perhaps you are not using a valid value for the Configuration property. Are you using the standard wizard UI or custom scripting this deployment?

Thanks,
Tom
Jun 12, 2014 at 3:03 PM
I'm using standard wizard UI and also there is Orchestration ItemGroup in project file.

<IncludeOrchestrations>True</IncludeOrchestrations>
  <!-- Orchestration artefacts to be included. -->
  <ItemGroup>
    <Orchestrations Include="$(ProjectName).Orchestrations.dll">
      <LocationPath>..\$(ProjectName).Orchestrations\bin\$(Configuration)</LocationPath>
    </Orchestrations>
  </ItemGroup>
Coordinator
Jun 12, 2014 at 3:35 PM
To help debug it, you could paste the following into the .btdfproj file (on the server):
<Target Name="PrintOrchestrationsQualified" BeforeTargets="UndeployOrchestrations">
  <Message Text="OrchestrationsQualified = @(OrchestrationsQualified)" />
</Target>
There are only two steps in UndeployOrchestrations -- one that opens the DLL(s) and reads the assembly information from each one, and another that runs GacUtil.exe. This target should print the assembly filenames into the BTDF output.

Double-check to make sure that the Orchestration DLL's are still present in the install folder on the server, because it can't undeploy without them (not in the GAC, in the Program Files folder for the app).

Thanks,
Tom
Jun 12, 2014 at 4:49 PM
Edited Jun 12, 2014 at 4:50 PM
This is the outcome and I confirmed that the orchestration assembly is there in install folder and the name is also correct (BizTalk.Test.App.Orchestrations.dll).
Build started 13/06/2014 2:10:21 AM.
__________________________________________________
Project "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\BizTalk.Test.App.Deployment.btdfproj" (Undeploy target(s)):

Target Undeploy:
    Target ServerUndeploy:
        Target UndeployBizTalkMgmtDB_true:
            Target SetWinVer:
                Running on Windows V61
                Detected IIS 7
                Detected 64-bit OS
            Target GetSoftwarePaths:
                Using .NET Framework Install Path 'C:\Windows\Microsoft.NET\Framework\v2.0.50727'.
                Using BizTalk Install Path 'C:\Program Files (x86)\Microsoft BizTalk Server 2010\'.
                Using Deployment Framework Install Path 'C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\'.
                Using Deployment Framework Tools Path 'C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools'.
                Using BizTalk ESB Toolkit Install Path 'C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit 2.1\'.
            Target ExportSettings:
                "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\EnvironmentSettingsExporter.exe" "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\EnvironmentSettings\SettingsFileGenerator.xml" "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\EnvironmentSettings"
                Environment Settings Spreadsheet to XML Exporter 1.6.0
                [http://EnvSettingsManager.codeplex.com]
                Copyright (C) 2007-10 Thomas F. Abraham.  All Rights Reserved.
                
                Importing from SettingsFileGenerator.xml...
                
                Output format is XmlPreprocess (multi-file).
                
                Exporting to Exported_LocalSettings.xml...
                Exporting to Exported_DevSettings.xml...
                Exporting to Exported_SITSettings.xml...
                Exporting to Exported_UATSettings.xml...
                Exporting to Exported_ProdSettings.xml...
                
                Finished.
            Target InitSettingsFilePath:
                Invalid settings file path (OK on server undeploy).
            Target StopBizTalk:
                iisreset.exe /noforce /restart /timeout:60
                
                Attempting stop...
                
                Internet services successfully stopped
                
                Attempting start...
                
                Internet services successfully restarted
                
                Target StopSelectedBizTalkHosts:
                    "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\cscript64.exe" /nologo "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\StopBizTalkHost.vbs" "Send_Host"
                    Stopping: Send_Host
                    "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\cscript64.exe" /nologo "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\StopBizTalkHost.vbs" "Receive_Host"
                    Stopping: Receive_Host
                    "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\cscript64.exe" /nologo "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\StopBizTalkHost.vbs" "Processing_Host"
                    Stopping: Processing_Host
            Target InitializeAppName:
                BizTalk Application Name is BizTalk.Test.App
            Target VerifyBizTalkAppExists:
                Checking for existence of BizTalk application 'BizTalk.Test.App'...
                Found BizTalk application 'BizTalk.Test.App'.
            Target PrepareAppForUndeploy:
                Target StopApplication:
                    (Retry count 0)
                    Stopping BizTalk.Test.App application...
                Checking for existing service instances associated with application 'BizTalk.Test.App'...
                Done checking for existing service instances associated with application 'BizTalk.Test.App'.
            Target UndeployBtsNtSvcExeConfig:
                Updating C:\Program Files (x86)\Microsoft BizTalk Server 2010\BTSNTSvc.exe.config...
                Removing AppDomain configuration data for AppDomain 'BizTalk.Test.App'...
                Saved updated BizTalk configuration file.
                Updating C:\Program Files (x86)\Microsoft BizTalk Server 2010\BTSNTSvc64.exe.config...
                Removing AppDomain configuration data for AppDomain 'BizTalk.Test.App'...
                Saved updated BizTalk configuration file.
            Target PrintOrchestrationsQualified:
                OrchestrationsQualified = ..\BizTalk.Test.App.Orchestrations.dll
            Target UndeployOrchestrations:
                "C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\gacutil.exe" /u ""
                Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.1
                Copyright (c) Microsoft Corporation.  All rights reserved.
                
                Failure removing assembly from cache:   The parameter is incorrect.
                
                C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\BizTalkDeploymentFramework.targets(1265,5): error MSB3073: The command ""C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\gacutil.exe" /u """ exited with code 1.
            Done building target "UndeployOrchestrations" in project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.
        Done building target "UndeployBizTalkMgmtDB_true" in project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.
    Done building target "ServerUndeploy" in project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.
Done building target "Undeploy" in project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.

Done building project "BizTalk.Test.App.Deployment.btdfproj" -- FAILED.

Build FAILED.

C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\BizTalkDeploymentFramework.targets(1265,5): error MSB3073: The command ""C:\Program Files (x86)\BizTalk.Test.App for BizTalk\1.0\Deployment\Framework\DeployTools\gacutil.exe" /u """ exited with code 1.
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:24.08
Coordinator
Jun 12, 2014 at 5:16 PM
The DLL path looks fine and you say the physical file exists. The only thing that is done on it before the gacutil is this code (simplified):
  System.Reflection.AssemblyName.GetAssemblyName(<filepath>).FullName;
You need to remove this after running the test, but try pasting this into the .btdfproj:
  <Target Name="UndeployOrchestrations" Condition="'$(IncludeOrchestrations)' == 'true'">
    <GenerateAssemblyNamesItemGroup SourceAssemblies="@(OrchestrationsQualified)">
      <Output TaskParameter="AssemblyNamesItemGroup" ItemName="OrchestrationAssemblyNamesGroup" />
    </GenerateAssemblyNamesItemGroup>

    <Message Text="OrchestrationAssemblyNamesGroup = @(OrchestrationAssemblyNamesGroup)" />

    <Exec Command="&quot;$(Gacutil)&quot; /u &quot;@(OrchestrationAssemblyNamesGroup)&quot;"
        Condition="%(Identity) == %(Identity)" />
  </Target>
I assume it is just going to print out an empty string, which would indicate that the reflection call isn't working -- although I'm not sure how that's possible.

Thanks,
Tom