locked
SPSolution.DeployedWebApplications : "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)." RRS feed

  • Question

  • I want to get list of the web application on which solution is deployed. For this I tried using "DeployedWebApplications" property of SPSolution Class.

    SPSolution.DeployedWebApplications

    But it gave me an error saying,

    Message: "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."

    StackTrace :
    "at System.Guid..ctor(String g)\r\n   at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.get_DeployedWebApplications()\r\n   at Microsoft.SharePoint.Administration.SPSolution.get_DeployedWebApplications()\r\n   at MOSSAnalysis.SPAnalysis"

    I tried to serach this error on google but didnt help.
    Is any one aware of the error. Other all properties of SPSolution object works properly but only "DeployedWebApplications" throws an exception.

    Thursday, September 22, 2011 4:04 AM

Answers

All replies

  • Hi,

    Go through the following link :

    http://www.koders.com/csharp/fid9B3F947E587676EEFB08448AACDD155C379BD01A.aspx?s=control

    You need to check SPSolution.ContainsWebApplicationResource  firstly and then check whether the solution is deployed or not

    Hope this solves your problem. :)

    Let me know if you have any queries.


    "The Only Way To Get Smarter Is By Playing A Smarter Opponent"
    • Marked as answer by sarvesh shinde Thursday, September 22, 2011 5:22 AM
    Thursday, September 22, 2011 5:20 AM
  • Hey Ravi... Thanks a lot.. Yes this helped me to resolve my issue.

    Actually I was directly accessing DeployedWebApplications property of SPSolution without confirming that whether that solution have any resources which can be deployed at web app level.

    ContainsWebApplicationResource this property let you know abt it.

    So now my new code lines which works properly are as follow..

     if (solution.ContainsWebApplicationResource)
     {
          if (solution.DeployedWebApplications != null)
          {
            foreach (SPWebApplication spWeb in solution.DeployedWebApplications)
            {
                 ......
            }
          }
    }

    Thursday, September 22, 2011 5:22 AM