Damon Armstrong

Caffeine Induced Tirades about .NET and Life
And don't forget to check out my latest Simple-Talk articles
Add to Technorati Favorites      Add to Google     

Wordpad may corrupt your SharePoint (and other ASP.NET app's) Web.confg

Published Friday, May 18, 2007 12:08 AM

I was remoting into a SharePoint 2007 (MOSS) box yesterday because I needed to update the configuration on a few of the servers in the farm.  Like most production systems, the server did not have Visual Studio, so I was using Notepad to edit the configuration.  As you may know, navigating through a configuration file in Notepad is a bit of pain compared to Visual Studio because it lacks the finesse of a full featured text editor.  My connection was also fairly slow so it was making my configuration task more irksome than normal.

Hoping to get a bit more control, I made the switch to Wordpad.  After making a couple of simple configuration changes, I refreshed the SharePoint site to make sure everything was okay.  I was greeted with an error screen.  Thinking that I must have made a typo, I checked over the configuration changes but didn’t see anything unusual.  So I decided to start removing things until the error went away.  Each time I removed a change, I refreshed the screen hoping to identify the issue.  The error screen persisted. 

Finally, I reverted back to the backup and the page popped back up no problem.  That’s when I started thinking something was really amiss.  I opened the working Web.config in Wordpad  and saved the file without making any changes.  The error was back.

I don’t know why, but Word pad randomly places little questions marks at various intervals throughout the Web.config.  I saw no rhyme or reason to the madness, but I confirmed it on multiple Windows 2003 servers.  So, if you’re configuring SharePoint, or any .NET application for that matter, on a remote machine, make sure to shy away from Wordpad because you’ll save yourself a headache.

Click on the following image to see the differences in the files:

by Damon
Attachment(s): CorruptCompare.gif

Comments

 

Kastaka said:

That's traditionally a symptom of 'I thought this was a unicode character that I couldn't cope with', although it coming up in a perfectly ordinary 'u' makes this sound less likely.
May 18, 2007 7:01 AM
 

Haywood said:

This is why I always remove WordPad from ANY server install...
May 25, 2007 11:33 AM
 

Damon said:

Wordpad in Windows XP seems to work just fine, so maybe the WordPad in Longhorn Server will work correctly.  I guess we'll just have to wait and see.  As for the unicode angle, I thought maybe that was the issue so I chose the save option that sounded closest to "normal, non-unicode text file" but it still bombed out.
May 25, 2007 6:15 PM
 

Flash said:

Usually when working in a terminal server / remote desktop situation, I can shuttle small text files to my FTP site and manipulate them in a more convenient editor. This, of course, depends on how good of a relationship I have with the network administrator.  If I do encounter one of those needs to happen, right-here-and-now situation I force myself to stick to Notepad, because Notepad seems to never let me down.
BTW, I believe we worked together at Heritage. Good times. FWT
August 10, 2007 3:00 AM
 

david_maung said:

I can confirm this issue.  We traced some corrupted ASP.NET files in a site to weekend edits in Wordpad.
April 9, 2008 4:10 PM
 

zt542 said:

I have also run into this issue several times. In my case it has only happened in remote desktop sessions SharePoint servers when editing web.config with Notepad or Wordpad. I wonder if Microsoft is aware of the problem, since this page is the only place I've ever seen it confirmed.
June 18, 2008 12:25 PM
 

Zarcom said:

I usually try to use Notepad ++, this also depends on the relationship I have with the server admin.
http://notepad-plus.sourceforge.net/uk/site.htm
July 9, 2008 5:38 PM
You need to sign in to comment on this blog

















<May 2007>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
Virtual Exchange Servers
 Microsoft now supports running Exchange Server 2007 in server virtualization environments, not just on... Read more...

Virtualizing Exchange: points for discussion
 With the increasing acceptance of the use of Virtualization as a means of providing server... Read more...

Encouraging .NET Reflector Add-ins
 Jason Haley is well-known for the resources he's provided to developers who wish to extend Reflector's... Read more...

Using .NET Reflector Add-ins
 .NET Reflector by itself is great, but it really comes into its own with the help of some add-ins. Here... Read more...

Unique Experiences!
 You'd have thought that a unique constraint was an easy concept - Not a bit of it; it can cause a lot... Read more...