Archive for Code

The XML page cannot be displayed

I’m just setting up RSinteract on a client’s 64 bit server which has Windows 2003 and SQL 2008. With most RSinteract installations IIS is installed as a prerequisite to Reporting Services but IIS isn’t needed for Reporting Services 2008. I guess this will become a common sticking point with SQL 2008 installations so here’s the solution…

The first problem I got was in the RSinteract installer (whoops, should have copied the error message) so we installed IIS and then RSinteract. When I hit the site I got this error:

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


A name was started with an invalid character. Error processing resource ‘http://myserver/RSinteract’. Line 1, Positio…

<%@ Page EnableViewState="false" Language="c#" ValidateRequest="false" AutoEventWireup="True" Codebehind="Main.aspx.cs" I…

I guess this is because IIS isn’t configured for ASPNET by default so I ran:

%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe –i

Which gave me the following error:

The error indicates that IIS is in 64 bit mode, while this application is a 32 bit application and thus not compatible.

So I made a slight change to point to the 64 bit .NET folder:

%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i

After an iisreset I was now getting a 404 error from aspx pages, the final step was to open IIS (type inetmgr at the command prompt) and go to the “Web Service Extensions” node and enable ASP.NET v2.0.50727. Another iisreset for good measure and we’re now up and running:)

Leave a Comment

Obsolete Attribute and XML Serialization

   1: public class MyClass
   2: {
   3:     private string _internalProperty;
   4:     private string _newProperty;
   5:  
   6:     [Obsolete("This is no longer required, but needed for backwards compatability")]
   7:     public string Property
   8:     {
   9:         get { return _internalProperty; } 
  10:         set { _internalProperty = value; }
  11:     }
  12:  
  13:     public string NewProperty
  14:     {
  15:         get { return _newProperty; }
  16:         set { _newProperty = value; }
  17:     }
  18:   
  19: }

This is an interesting little anomaly in the way XML Serialization handles the “Obsolete” attribute on class properties when serializing to and from XML. The attribute is treated as an “XmlIgnore” attribute, meaning that the property is not serialized. It is well documented that adding the aforementioned attribute to a property in .NET 3.5 will cause this behavior, however, it is not mentioned in the same MSDN page for .NET 2.0 on the same subject.

This one caught me out. Apparently the only two ways to fix it are: to take the attributes off or use the “ShouldSerializeX” method constructs as demonstrated below…

   1: public bool ShouldSerializeProperty()
   2: {
   3:     return true;
   4: }

Leave a Comment