Hi. I've written some code that imports a solution using the ImportSolutionRequest.
I execute the request with ExecuteAsyncRequest, and then periodically check the status of the request to see if the import was successful. Then I execute a PublishAllXmlRequest.
When I do this, everthing works fine, EXCEPT that I have a whole lot of Plug-in Steps that are disabled.
The Weird thing is if I import that same solution manually using the web client, the plug-in steps get enabled just fine.
Any ideas what could be causing this? Am I missing something?
Thanks
(I've included the code below if it helps)
byte[] fileBytes = File.ReadAllBytes("Solution Files\\" + solutions[i]);
ImportSolutionRequest impSolReq = new ImportSolutionRequest()
{
CustomizationFile = fileBytes,
ImportJobId = Guid.NewGuid(),
OverwriteUnmanagedCustomizations = true,
SkipProductUpdateDependencies = true,
PublishWorkflows = false,
};
ExecuteAsyncRequest importRequest = new ExecuteAsyncRequest()
{
Request = impSolReq
};
ExecuteAsyncResponse importRequestResponse = (ExecuteAsyncResponse)_client.Execute(importRequest);
// Block for 30 seconds
string solutionImportResult = null;
while (solutionImportResult == null)
{
System.Threading.Thread.Sleep(30000);
Console.Write(".");
Guid asyncJobId = importRequestResponse.AsyncJobId;
Entity job = (Entity)_client.Retrieve("asyncoperation",
asyncJobId,
new ColumnSet(new System.String[] { "asyncoperationid", "statuscode", "message" }));
int jobStatusCode = ((OptionSetValue)job["statuscode"]).Value;
switch (jobStatusCode)
{
// Success
case 30:
Console.WriteLine(" Done");
solutionImportResult = "success";
break;
//Pausing //Canceling //Failed //Canceled
case 21:
case 22:
case 31:
case 32:
throw new Exception(string.Format("Solution Import Failed: {0}{1}",
jobStatusCode,
job["message"]));
default:
break;
}
}
if (solutionImportResult=="success")
{
PublishChanges();
}
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (