Project Server 2010: My PWA site thinks it is a Workspace (Site) Revisited

I posted a couple of weeks back about this scenario http://blogs.msdn.com/brismith/archive/2010/05/07/project-server-2010-my-first-fix-with-powershell-a-pwa-site-that-thought-it-was-also-a-workspace.aspx , which can be resolved with PowerShell in 2010, or through the UI in 2007 – but it appears there may also be a scenario where the UI does not show the PWA site associated with a project, yet still the rogue properties are set.  So without PowerShell you can instead use code to look at, and if necessary remove the values from these properties. 

A couple of snippets of code that might help you do this (you will need a reference to Microsoft.SharePoint):

To read the properties:-

using (SPSite site = new SPSite("hhtp://servername/pwa"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                   String sPWAURL = web.AllProperties["PWAURL"].ToString();
                   String sMsPWAPROJUID = web.AllProperties["MSPWAPROJUID"].ToString();
                }
            }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }You could either output the strings or just view in debug – or build a little forms app around this.

And to set then to NULL

using (SPSite site = new SPSite("http://servername/pwa”))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    web.AllProperties["PWAURL"]="";
                    web.AllProperties["MSPWAPROJUID"]="";
                    web.Update();
                }
            }

I could be persuaded to use String.Empty in place of “”. 

I’d certainly be interested to hear if many customers run in to this issue – and one clue that you have the Project Workspaces (or Sites, in 2010) Collaboration List feature turned on is seeing Issues, Risks, Deliverables and Project Documents on the main PWA site.

Technorati Tags: ,