Currently when generating a class with SPMetal from a site that has spaces in it
SPMetal.exe /web:"http://flxdev2010:19000/PWA/Test Plan" /namespace:ProjectSite /code:ProjectSite.cs
It will give
Error the web at 'http://flxdev2010:19000/PWA/Test Plan' could not be found
Oh dear, a schoolboy error.
Now you could use stsadm to dump out the site, delete and reimport, yikes. Or you can just rename the Url as ServerRelativeUrl is read/write (any outside links point to the Url will not be fixed up!)
Using a quick console app
using (SPSite site = new SPSite("http://flxdev2010:19000/PWA/Test Plan"))
using( SPWeb web = site.OpenWeb())
{ string s = web.ServerRelativeUrl; web.ServerRelativeUrl = "/PWA/TestPlan"; web.Update();
}
or that new fangled 4 year old PowerShell thingy
Start-SPAssignment -Global
Start-SPAssignment
-Global
$web
=
Get-SPWeb
"http://flxdev2010:19000/PWA/Test Plan"
.Title =
"/PWA/TestPlan"
.Update()
Stop-SPAssignment
SPMetal.exe /web:"http://flxdev2010:19000/PWA/TestPlan" /namespace:ProjectSite /code:ProjectSite.cs
now works.
you can change it back once you have the definition.
Remember Me
a@href@title, strike
Powered by: newtelligence dasBlog 2.0.7226.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Colin Byrne
E-mail