.NET Fixing C# XML Comments so they Work in Windows XP SP2

Previous Topic Previous Next Topic Next
Xoc Software
RVBA Conventions
Maya Calendar Program
Company Information
ASP.NET and Other Tips
.NET: Debugging Designer Features of a Custom Control in Visual Studio
.NET: Setting the Default Font in a Windows Mobile/Compact Framework Custom Control
.NET Fixing C# XML Comments so they Work in Windows XP SP2
.NET: Getting and Setting the Application Version Number
.NET: Getting the Path of the Executing Assembly
.NET: Retrieving Assembly Attributes
.NET: Setting the RootFolder to Other Values in the FolderBrowserDialog in .NET
.NET: Sizing Columns in a ListView Control in .NET
.NET: Using Remoting in .NET
ASP.NET: Constructing a Graphic on the Fly in ASP.NET
ASP.NET: Controlling Caching in ASP.NET Web Forms
ASP.NET: How to use the FrontPage Server Extensions with ASP.NET
ASP.NET: Seeing What is in the ViewState in ASP.NET Web Forms
ASP.NET: Using Forms Authentication in ASP.NET
ASP.NET: View Trace Information on your ASP.NET Web Pages
ASP: Create XML from an ADO query
ASP: Detect Incomplete Loads
ASP: Including an ASP.NET Web Page In a Classic ASP Web Page
ASP: Process .HTM Files with Scripts and Server Side Includes
ASP: QuickSort Algorithm
ASP: Retrieve all server variables from IIS
ASP: Send Email from Active Server Page
HTML: How to Create a Non-Scrolling Region in HTML
IE: Allowing Only Certain ActiveX Controls to Run in Internet Explorer
IIS: Creating a web site for testing in IIS Server
IIS: Creating Multiple Web Sites within IIS on Windows 2000 and Windows XP Professional
IIS: IIS/Visual InterDev Problems and Fixes
IIS: Redirect a domain such as xoc.net to www.xoc.net
SQL Server: Execute SQL Server Updategram
Web Design: Design for People with Disabilities
Web Design: Keep a Web Page out of the Google Cache
Windows: Get HTTP Header of a Web Page using Telnet
Windows: Testing Domain Names without DNS
Windows: Using Hosts File to Access Web Sites with XP SP2
Windows: Windows XP Command Line Tools
Windows Mobile: Reprogramming the Push-to-Talk Button on the AT&T Tilt

Other Xoc managed sites:

The C# language in Visual Studio 2003 allows you to create XML comments by including comments that start with ///. Unfortunately, Window XP Service Pack 2 (SP2) causes those comment pages not to display correctly. What happens is that the compiler that creates the comments places a special comment in the header of each page, called a Mark of the Web (MOTW). This MOTW causes Windows XP to place the pages constructed by the comment compiler into the Restricted Zone, where none of the comment page functionality works.

There is no easy solution to the problem. I did, however, come up with a not-so-easy solution. You can modify each file to place it into the Internet Zone instead of the Restricted Zone. You can do this with a batch file that executes a Windows version of the Unix SED utility. You will need to download the SED utility from somewhere. One place you can download the utility is from SourceForge.

You will then need a batch file that will modify your files. That batch file should look like this:

Save this file to fixdoc.bat. Make sure SED is on the path, or modify the batch file to have the full path to the SED program, like this:

where c:\program files\utilities is replaced by the location where the SED program was saved.

After you have these two tools, you can then fix the documentation files by running:

fixdoc c:\src\myprog\documentation

where c:\src\myprog\documentation should be replaced by the location of your XML documentation files. This fixes the MOTW to place the files in the Internet Zone instead of the Restricted Zone.

You can then add the fixdoc command to the Tools Menu of Visual Studio as an External Tool. Make sure you set both the arguments and initial directory textboxes to be the full path of where your document files are stored, and check the checkbox for use output window.