Total Pageviews

Monday, 14 March 2016

Export the solution using c# code from MS CRM

Hi friends ,

Today i was surprised , when i am trying to export  unmanaged solution not able to get the solution file from crm. I tried with chrome , firefox and ie but no result. i tried to export the solution so many times but solution not exported and other side client is waiting for the solution , think once if u people have the same situation what you will do ? of course at this situation may have some tense , some frustration.

At last i exported the solution successfully . How ?

With the help of c# code .

 public static void ExportSolution(OrganizationServiceProxy service)
        {
            ExportSolutionRequest exportSolutionRequest = new ExportSolutionRequest();
            //here i am exporting solution as unmanaged , if you want to export as managed means put true.
            exportSolutionRequest.Managed = false;
            //give solution unique name
            exportSolutionRequest.SolutionName = "DllSol";

            ExportSolutionResponse exportSolutionResponse = (ExportSolutionResponse)service.Execute(exportSolutionRequest);

            byte[] exportXml = exportSolutionResponse.ExportSolutionFile;
            string filename = "DllSol.zip";
//give path where the solkution file need to store
            System.IO.File.WriteAllBytes(@"C:\Kranthi\" + filename, exportXml);
        }

using this peace of code i exported the solution.


2 comments:

  1. I must thank you for the efforts you have put in penning this site. I am hoping to check out the same high-grade content by you later on as well. In truth, your creative writing abilities has inspired me to get my own, personal blog now..
    CRM Software in India
    CRM Software in Chennai

    ReplyDelete
  2. Beaver says I also have such interest, you can read my profile here: database management

    ReplyDelete