Edit file in Wss3 web application with SharePoint Designer blows up your web site
I wanted to create a simple html file in the root of my Wss3 web application, so I created an empty file test.htm. I double clicked te file and because I have SharePoint Designer installed, it is the default editor for .htm files. I put some test into the .htm file along the lines of "Hello world!", and boom: my Wss3 web application is dead. I get the following error:
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.Parser Error Message: Data at the root level is invalid. Line 1, position 1.
Source Error:
Line 1: <browsers> Line 2: <browser id="Safari2" parentID="Safari1Plus"> Line 3: <controlAdapters>
Source File: /App_Browsers/compat.browser Line: 1
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
After some searching I found what happened:
When you open a file with SharePoint Designer, it creates all kind of FrontPage Server Extension functionality in your web application. One thing it does it that it creates a _vti_cnf folder in every folder you have in your web application. If you remove all these folders you fix your problem.
I don't know of a handy DOS command to delete all these folders recursively, but with some PowerShell I solved the problem.
Open a PowerShell prompt, set the current directory to the folder hosting your web application and execute the following command to see the "damage":
PS C:\Inetpub\wwwroot\wss\VirtualDirectories\wss3dev> get-childitem -path . -name _vti_cnf -recurse
Now execute the following PowerShell command to kill all these folders and become a happy camper again: PS C:\Inetpub\wwwroot\wss\VirtualDirectories\wss3dev> get-childitem -path . -name _vti_cnf -recurse | % { remove-item -Path $_ -recurse }
_vti_cnf
<br />App_Browsers\_vti_cnf
<br />App_GlobalResources\_vti_cnf
<br />aspnet_client\system_web\2_0_50727\CrystalReportWebFormViewer3\CSs\_vti_cnf
<br />aspnet_client\system_web\2_0_50727\CrystalReportWebFormViewer3\html\_vti_cnf
<br />aspnet_client\system_web\2_0_50727\CrystalReportWebFormViewer3\Images\ToolBar\_vti_cnf
<br />aspnet_client\system_web\2_0_50727\CrystalReportWebFormViewer3\Images\Tree\_vti_cnf
<br />aspnet_client\system_web\2_0_50727\CrystalReportWebFormViewer3\JS\_vti_cnf
<br />wpresources\_vti_cnf
<br />_app_bin\_vti_cnf</font></p>