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
_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>

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 }

10 Comments

  • Seems that the command "deltree" from the good old days is no longer included in the windows console :(

  • Use RD /s /q instead of deltree.

  • Don't know which direction the comments are going, but RD is same as RMDIR, and is for removing a directory and all its subdirectories... YOU CAN'T USE IT TO REMOVE RECURSIVELY ALL FOLDERS NAMED _vti_cnf, WHILE THE REST OF FILES AND SUBFOLDER REMAIN INTACT.

  • Has anyone found a way to prevent this from happening every time I edit or create a file in Designer? Let's say I work on a file in Designer (after of course, I have deleted all the _vti_cnf folders), close it out for the day and then need to work on some files on that site the next day…. There I am again, deleting all the _vti_cnf folders.
    Any ideas?

  • A simple solution is not to use SharePoint Designer as an editor for HTML pages.

    Or, create a new ASP page instead, put your HTML in that (Designer treats it the same) and then change the extension to HTML outside of Designer after saving.

    Or, hassle MS to fix what is obviously a very large problem.

  • Super! This solved a BIG issue for me. Thanks!

  • This fix worked for me, thanks. In my case, all I did was edit a pre-existing css file in a virtual directory with SPD. Big mistake.

    Thanks for posting the workaround and keep up the good work.

  • The fix worked for me. I was testing a new installation of SharePoint Designer and I blew out the SP web site. I need to make sure my developers don't make the same mistake.

    Thanks for posting the problem and the workaround.

  • Super Guru!!! Its resolvs my problem... Thanks a lot...

  • Great, big issue resolved for me.
    But does MS wait for resolve this problem?

    Thanks

Comments have been disabled for this content.