Thursday, December 17, 2009
I recently started working for a large client with a global presence whose IT policies are well-established, difficult to change and not always up-to-date. In that vein, enter the corporate VPN: it's a web-based signin with a host checker that doesn't support any x64 OS.
This prompted me, running Win 7 x64, to try to get a co-worker's Hyper-V Win2k3 x86 MOSS VM and run it in Windows Virtual PC. Seems like a logical thing to do, right? I mean, a Microsoft VHD should work, and be able to be imported by other Microsoft tools, right? Wrong. After spending quite a bit of time trying to attach the VHD in Windows Virtual PC and boot directly into it, I concluded that this was not possible.
Apparently, you can only run VMs using the same architecture as the host in Windows Virtual PC. And you can only boot into a VM that was created on your machine using that method.
To solve my problem, I wiped my machine and installed Windows Server 2008 R2 to take advantage of Hyper-V. While I was at it, I grabbed an image of Windows Server 2003 x86 and built a nice development machine to use for this client.
My problem was solved, but I think in the future, I'll use the open-source VirtualBox by Sun if I'm not able to use Hyper-V. A colleague grabbed one of my Hyper-V VMs the other day and was signed into it from his Windows 7 host using VirtualBox within minutes.
Another annoyance is the resizing of VHD files. My client VM mentioned above was created as a dynamic 30GB disk. The space was quickly filled and my performance was soon shot. Compounding the issue was the fact that I had half a dozen snapshots. While Hyper-V does let you merge snapshots, the process is painful, to say the least.
Resizing the .vhd file can be done using some third-party tools (beware if you have snapshots or a dynamic disk) like VHD Resizer, but that doesn't address the problem of resizing the system partition within the VM itself. Resizing the boot partition isn't supported in Windows Server 2003, so I ended up using another open-source tool, Gparted. Boot into the VM using this tool and it's a breeze to resize the system partition.
I really wish Microsoft would make their virtualization technologies a little more robust in the future.
Wednesday, November 25, 2009
Monday, November 16, 2009
Thursday, October 15, 2009
The fine people at Smashing Magazine have dissected all of the differences for us in this very useful article:
Monday, October 5, 2009
Thursday, September 24, 2009
MailMessage message = new MailMessage();
message.From = new MailAddress(list.ParentWeb.Site.WebApplication.OutboundMailSenderAddress);
message.Subject = "Subject";
message.Body = "Body";
SmtpClient smtpClient = new SmtpClient(SPContext.Current.Site.WebApplication.OutboundMailServiceInstance.Server.Address);
Thursday, August 13, 2009
Tuesday, August 4, 2009
Thursday, July 16, 2009
Randy Williams wrote and 8 part series over at SharePointMagazine.com that you should check out.
Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8
Monday, July 13, 2009
Tuesday, July 7, 2009
First, you need to download two things to follow along:
Next, follow these steps:
- Create a new project in STSDEV, use the empty project C# assembly
- Add a new Web Service Application Project to your solution
- Add your web method to your web service. (If you just want to test this out, the default HelloWorld will work)
- Run the WSS Web Service Helper against your .asmx file (in your web service project). This will autogenerate your wsdl and disco .aspx files.
- Copy the .asmx file and the .cs codebehind (your webservice) and the two .aspx files generated by the WSS Web Service Helper and place them into your Rootfiles/ISAPI folder in your STSDev project.
- Go to your .asmx file and delete the CodeBehind attribute of the Webservice tag and place the fully qualified assembly string into the Class attribute (Namespace.Class, Assembly, Version, Culture, PublicKey)
- Go into the Generated *disco.aspx file and for both of the soap tags replace the address attribute with <% SPEncode.WriteHtmlEncodeWithQuote(Response,SPWeb.OriginalBaseUrl(Request), '"'); %>
- Next go to the *wsdl.aspx file and (at the bottom of the file) replace the location attribute of the soap12:address tag with <% SPEncode.WriteHtmlEncodeWithQuote(Response,SPWeb.OriginalBaseUrl(Request), '"'); %>
- Also in both the *disco.aspx and *wsdl.aspx files you need to change the <@ assembly tag to this:
<%@ Assembly Name="Microsoft.SharePoint, Version=220.127.116.11, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
because the .disco generator puts the wrong version and adds an extra Microsoft.SharePoint to the assembly reference.
- Deploy your project and test.
- Finally, if you have trouble, go here for troubleshooting, the tips are at the bottom of the article.
Tuesday, June 9, 2009
- First make sure you've attempted to put your filter expression into view through the UI (this will place the appropriate columns in your Where clause so it will be easier to move things around.
- Open the list view page in SharePoint designer
- Find the <listviewxml> node
- Between the
node you'll see that there is a lot of cryptic looking text that has a lot of < and > markup in it. This is the XML markup for the list view definition, we'll need to modify a part of this to alter the list view correctly
- Within this cryptic text look for '<Where', this is the beginning tag of the where clause. Once you find it, place your cursor before the '&' and highlight to the '\Where>'
- Copy this entire expression and paste it into notepad (or any other text editor)
- Do a replace on the text, replacing '<' with '<' and '>' with '>', now the text looks like xml (optionally, put in line breaks to make it easier to read)
- Now you have to build your expression, my suggestion is to start with the outermost expression and work your way in
For example, Expression 1 builds up like so (this example doesn't include the correct syntax for the columns, only the logic):
- When you finally have it correct, remove your line breaks, and do a replace swapping '<' for '<' and '>' for '>'
- Paste the new where clause over the old where clause and save the page (this will customize the page from the site defintion)
Tuesday, June 2, 2009
The behavior we saw was that you could see all the page content in edit mode, but none of it would show up when it was checked in/published. Also, there was some odd rendering of the page in edit mode.
I was scratching my head over this for a while and pretty much randomly stumbled onto the solution. In the future, I'd suggest removing any non alpha-numeric characters from file names just to be safe, even though SharePoint doesn't warn you or remove them.
Wednesday, May 20, 2009
Check it out here on Channel 9.
Although the really interesting stuff is going to come with the release of the VS 2010 Tools for SharePoint, I was very excited to see what SharePoint surprises were tucked inside of the Visual Studio 2010 Beta that was released this week on MSDN.
When first choosing a SharePoint project template, nothing is available. This is because the default framework version selected is 4.0.
Switching to version 3.5 yields the SharePoint 2007 Sequential and State Machine Workflow templates.
Ultimately, attempting to create either of these projects failed. The folders were created in the file system, but there were no project, solution or workflow files to be seen.
I'm looking forward to the beta 2 / RC!
Monday, May 4, 2009
A client of mine recently had an issue where he wanted to insert a direct link to a FileMaker Pro document (e.g. fmp://...) in SharePoint. Both the rich text and source editors were stripping out the link, making life even more miserable for my FileMaker Pro-dependent client.
It turns out that SharePoint controls the list of allowed protocols in a static .js file, and not in Central Administration, as one might be inclined to assume.
Here's the solution:
- Open Core.js in Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\INC
- Look for the line with the text "Hyperlink.arrAllowedProtocols"
- Add the necessary protocol to the list of protocols below
- Insert the previously outlawed protocol link to test
Friday, April 17, 2009
...for an incorrect target database:The broken jobs probably point to databases that no longer exist, so make sure the job's target database is your (new) SSP database, and that the job executes as the [domain]\SQLService user you specified during the MOSS install. You can disable or delete any old jobs. If the job hasn't been running for a while, you have probably noticed that SQL gobbles up all the RAM it has access to. Yum.
 SQLServer Error: 18456, Login failed for user 'DOMAIN\MOSSSQLService'. [SQLSTATE 28000]
 SQLServer Error: 4060, Cannot open database "SharedServices_Provider_SSPPrimary" requested by the login. The login failed. [SQLSTATE 42000]
...for an incorrect user account
 SQLServer Error: 15404, Could not obtain information about Windows NT group/user 'DOMAIN\MOSSWrongUser', error code 0x5. [SQLSTATE 42000] (ConnIsLoginSysAdmin)
Monday, March 23, 2009
Thursday, February 26, 2009
Repeat this process for each front end-web server:
- Open C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\AclInv.aspx
- Find the control with ID="chkSendEmail"
- change the Checked="True" attribute of this control to Checked="False".
- No IISRESET is required
To get a ScriptManager to dynamically add for your web part, add a ScriptManager declaration to your class:
then add this code to your CreateChildControls method:
if(_scriptManger == null)
//first check to see if there is a ScriptManager loaded on the page already
_scriptManager = ScriptManager.GetCurrent(this.Page);
if(_scriptManager == null)
//since there wasn't one on the page, we create a new one and add it to the controls collection
_scriptManager = new ScriptManager();
Thursday, January 29, 2009
Apparently the .vbs script that the $(ISSAPP_SCRIPT) token in the DebugRefreshAssemblyInGAC section is referring to (C:\windows\system32\iisapp.vbs), will not run until you make CScript your default script environment for *.vbs scripts.
In order to fix the errors STSDEV gives you follow these steps:
- Go to C:\Windows\System32 and copy cscript.exe and iisapp.vbs
- Place the files in another folder (I used 'C:\Utilities\Builds' as you see below)
- alter your DebugRefreshAssemblyInGac to read as follows
<Target Name="DebugRefreshAssemblyInGac" >
<Message Text="(Re)installing assembly in GAC and recycling app pool" Importance="high" />
<Exec Command="$(GACUTIL) -if $(TargetPath)" />
<Exec Command='cscript.exe iisapp.vbs /a "SharePoint - 80" /r' WorkingDirectory='C:\Utilities\Builds'/>
<Message Text="" Importance="high" />
- Close your solution, then reopen and retry your build
Wednesday, January 28, 2009
- RAMP UPs: http://msdn.microsoft.com/en-us/rampup/dd221355.aspx
These seem pretty helpful. I'm most interested in the workflow (since it's been a while since I've done WF development in SP and SilverLight, because that's just so darn cool.
- Social Networking features of SharePoint: http://www.microsoft.com/events/series/detail/webcastdetails.aspx?seriesid=92&webcastid=5448
Chances are, unless you're brand new to MOSS, you've probably seen everything in the first 10 minutes, so skip ahead and get to the AdventureWorks demo.
Monday, January 26, 2009
Only Content controls are allowed directly in a content page that contains Content controls.
Whats the deal? Everything looked exactly like the previous, working layout... or so I thought. The copy and paste apparently changed some of the <asp:Content> controls to <asp:content>, which SharePoint does not like. Re-capitalizing my tags fixed the issue.
Friday, January 23, 2009
Just do a find and replace.
Thursday, January 15, 2009
The file manifest.xml does not exist in the solution package.
A blogger at PointBridge was nice enough to document this here, but the fix is fairly simple so I've added the code below.
To fix your solution packages, you'll need the source for STSDEV. Open the file \STSDev\Core\Builders\DeploymentFiles\CabDdfBuilder.cs, and enter the following at the end of the .ddf settings section, and recompile:
writer.WriteLine(".Set CabinetFileCountThreshold=0 ");
Packages generated with your new STSDEV build will no longer be truncated.
Wednesday, January 14, 2009
Trying to use it and have an alert triggered by your newly copied file? Forget it.
MoveTo() copies the binary to the target library as expected, but fails to recreate the item metadata (created, modified, users, dates, etc.) and will not trigger the alerts that your users set up for the target library.
To work around this problem, you can create your own method that uses the SPFileCollection.Add(), which allows you to specify metadata, as described here:
Thursday, January 8, 2009
A current project I'm working on requires me to create a web service based on an established WSDL that would be consumed by another service. In order for there to be interoperability between the 2, my WSDL and the reference WSDL had to be identical.
I went about creating the proxy class using WSDL.exe as I normally would and had my simple service up and running in about 5 minutes. When the external service tried to connect to mine, there was the "Server did not recognize the value of HTTP Header SOAPAction" error.
Upon closer examination, my WSDL was identical to theirs with one exception:
<soap:operation soapAction="FaultyAction" style="document" />
Should have been:
<soap:operation soapAction="" style="document" />
After some web-scouring, I finally determined how to set the soapAction attribute in the WSDL:
public Gateway_Response Gateway_Request(Gateway_Request returnValue)
Wednesday, January 7, 2009
<img src="<% $SPUrl:~SiteCollection/Style%20Library/MyImage.gif%>" />Why won't this work? This doesn't work because the inline code is in a standard html tag and not a server control, and it doesn't get evaluated when the page is parsed, so the entire inline expression is just interpreted as a literal string. When this happens, you'll get this error:
Literal expressions like '<% $SPUrl:~SiteCollection/Style%20Library/MyImage.gif%>' are not allowed.I know this is .Net 101, but if you aren't paying attention it's easy to overlook. So... don't forget to either use