2

抱歉,如果这非常明显,但我找不到有关如何通过 SDK 从组织中删除解决方案的信息。

我已经使用 ImportSolutionRequest 对象成功完成了导入,但找不到删除解决方案的等效项。

4

1 回答 1

4

MS在MSDN上有一个指南here

从那个链接

using (_serviceProxy = ServerConnection.GetOrganizationProxy(serverConfig))
{
    // This statement is required to enable early-bound type support.
    _serviceProxy.EnableProxyTypes();

    // Delete a solution
    QueryExpression queryImportedSolution = new QueryExpression
    {
        EntityName = Solution.EntityLogicalName,
        ColumnSet = new ColumnSet(new string[] { "solutionid", "friendlyname" }),
        Criteria = new FilterExpression()
    };
    queryImportedSolution.Criteria.AddCondition("uniquename", ConditionOperator.Equal, ImportedSolutionName);
    Solution ImportedSolution = (Solution)_serviceProxy.RetrieveMultiple(queryImportedSolution).Entities[0];
    _serviceProxy.Delete(Solution.EntityLogicalName, (Guid)ImportedSolution.SolutionId);
}
于 2013-03-15T15:32:05.930 回答