Windows 7 Cannot Save Documents to SharePoint 2007/Windows Server 2008

After we began rolling out Windows 7 at the day job, we found our first issue–when people checked out documents from SharePoint 2007, the documents were opened as "Read Only", and the users could not save the edited document back to the portal.  The work-around was to save the document locally and re-upload.

After four months of working with Microsoft, we were able to find the solution.  The problem was in URLScan, and Windows 7's use of the OPTIONS verb.  By default, this verb is blocked.  If you look in the URLScan logs (by default, %WINDIR%\system32\inetsrv\urlscan\logs), you'll see an entry like the following (important parts are in bold):

2010-03-19 02:12:15 127.0.0.1 778810668 OPTIONS /<document library path>/ Rejected verb+not+allowed HTTP+method – –

All we need to do to fix this problem is edit urlscan.ini by default, (%WINDIR%\system32\inetsrv\urlscan), find the [AllowVerbs] section and add OPTIONS.  Then scroll down a little to the [DenyVerbs] section, and remove OPTIONS from that list.  Do an IISRESET and all is well.

For reference, our server platform is Windows Server 2008/IIS 7/SharePoint 2007, and clients are Windows 7 Professional using IE8.  This issue does not seem to affect Windows XP users with IE 8.

Questions/comments?  Please use the contact form.  Because of jackass comment spammers, I've had to turn off comments for a while.

Installing PHP on Windows 7/IIS 7 with Windows Platform Installer

Download the Web Platform Installer from http://www.microsoft.com/web/Downloads/platform.aspx.  Must do this when connected to the Internet, since the installers download the latest components from the web.  You also need to install PHP before you install the PHP-based applications, too.

After you download the small installer, run it, and you’ll see an Open File warning.  Click Run to continue, and the installation will begin.

image 

image

At this point, you’ll receive a UAC warning.  Allow the WPI to install itself.

image

It was at this point I received an error on my first try (see below).  Upon retrying the installation, it worked.

Once the WPI is installed, it will update itself with the latest packages and components.  You’ll receive another UAC, and then you’ll see this window, where you can add components or apps.

image

To install PHP, select the Web Platform tab, then under “Frameworks and Runtimes” click Customize, then choose PHP from the list.

image

Click Install, and review the list of components that will be installed.

image

Click I Accept, and installation will begin.

image

After a few minutes, you’ll have PHP installed on your system.

image

Configuring Expression Web 3 for PHP

The PHP components are installed in c:\program files\php.  If you use Expression Web 3, you can configure PHP under Tools >> Application Options >> General, then browsing to the php-cgi.exe.

image

Testing the PHP Installation

To test your PHP installation, open the IIS Management Console and create a new application.  Inside of this application, add a file named test.php and with the following code in it:

<?php
Print "Hello, World!";
?>

Load this file in your web browser, and if you see the message, you’re set to go!

image 

Installation Error

The first time I ran through the installation, I received the following error:

The Web Platform Installer  could not start.  Please report the following error on the Web Platform Installer forum.  http://forums.iis.net/1155.aspx

I checked out the Application Log, and that was no help:

Product: Microsoft Web Platform Installer 2.0 RC — Installation failed.

Before I went to the IIS forum, I tried to recreate the issue by running the installer again, and this time it worked.  So if you get this error, wait a moment and try it again.

Installing IIS 7 on Windows 7 for .NET Development

We’ll set up the basic features for developing in ASP.NET.  Most websites should be up and running with no problems.

To start the installation, go to Start >> Control Panel >> Programs.  Under Programs and Features, click “Turn Windows features on or off”.

image

The Windows Features window will open, and you’ll see Internet Information Services listed.  For .NET Development, installation is not as simple as just checking the top level checkbox.

image

Expand Internet Information Services >> Web Management Tools.  We need a way to manage our server, and in Windows 7, we use the IIS Management Console.  After you expand Web Management Tools, choose IIS Management Console.

image

Now expand Application Development Features, and select .NET Extensibility and ASP.NETISAPI Extensions and ISAPI Filters will automatically be selected when you choose ASP.NET.

image

Looking down the list a little, we see Common HTTP Features has something selected.  Expanding this node shows Default Document is chosen—it’s automatically selected when you chose ASP.NET above.  If your site includes HTML pages or other static content, you should also choose Static Content.  Most sites have some form of static content, so it’s a good idea to check this option.

image

Expand Health and Diagnostics, there are a couple options we need—HTTP Logging and Tracing.  Some of the other features are nifty, but setting them up is beyond the scope of this post.

image

Finally, you’ll see Security also has an option chosen—Request Filtering is automatically selected when you chose ASP.NET above.  For our local development machines, you need to select Windows Authentication, it’s necessary for debugging.

image

That’s all we need for basic ASP.NET development.  Click OK, and Windows setup will install IIS and the features we selected.  They’re not kidding about “several minutes”.  Be patient.  When the installer is done, it just disappears.

image

You can test your installation by navigating to http://localhost/, and if you see the IIS 7 splash screen, you’re good to go.

image

You’ll find the IIS Management Console in the same place as before, under Computer Management.  If this is your first experience with the IIS 7 console, it’s going to be a little mind boggling.  Everything is different.  To learn more about IIS 7 in depth, check out http://www.iis.net/.  In addition to the tutorials, there are loads of modules to extend the functionality of IIS.

Compiler Error Message: BC2017: could not find library

One of my web apps uses SQL Server Reporting Services, and began throwing this error the other day:

Compiler Error Message: BC2017: could not find library ‘c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\…’

The file name in the path refers to a temporary file with a random name.

Last time I saw a similar error message, the permissions on the Temporary ASP.NET Files folder needed to be modified.  I was using impersonation, and the impersonated user needed MODIFY permissions.  It didn’t make sense in this case, since we hadn’t made any changes and weren’t using impersonation.

Just to be sure, we added the ASPNET user with Modify permissions, and the report ran!  As an experiment, we removed the ASPNET user, and the report sill ran!  This made no sense, so I hunted down the network manager to see what MS update may have been installed on my web server.  Instead, they had decommissioned the old primary domain controller, and promoted a newer BDC to become the PDC.  This web server is Windows 2000 (and is to be replaced this year), and our guess is that IIS was using a token cached from the old PDC, which wasn’t validating against the new PDC.

Whatever the case, tweaking the permissions worked.  In other cases, you may need to leave the impersonated user assigned to the folder.  This is usually the case when you try and access the report for the first time.

DotNetKicks Image