SPWeb.Confiugration Always returning -1 : Bug or No bug?

The Configuration attribute of the SPWeb object always returns -1.

Here is the code I'm using:

SPSite site = new SPSite(siteColName);
SPWebCollection webCol = site.AllWebs;

Console.WriteLine();
Console.WriteLine(site.WebApplication.Name + "\n");
for (int i = 0; i < webCol.Count; i++)
{
Console.WriteLine("'" + webCol[ i ].Name.ToString() + "' ==> " + webCol[ i ].WebTemplateId.ToString() + ", " + webCol[ i ].WebTemplate.ToString() + ", configuration: " + webCol[ i ].Configuration);
}

The .Configuration property is always returning -1.

Is there another way to get the Site Template configuration number

Thanks,

Joubin Najmaie

blog: www.joubin.net



Answer this question

SPWeb.Confiugration Always returning -1 : Bug or No bug?

  • shibin

    check out other people who came across same issue:

    http://blog.krichie.com/2007/01/30/spwebconfiguration-bug/



  • Rosh K Mathews

    >Is there another way to get the Site Template configuration number

    Yes. Instead of using AllWebs, you may in some scenarios use GetSubwebsForCurrentUser, in which case Configuration will be populated. It all depends on what you need to do. Of course by impersonating a priviligied account you can have that method return _all_ webs.


    Hope that helps



  • SPWeb.Confiugration Always returning -1 : Bug or No bug?