ASP.NET 1.1 Applications and SharePoint 2007

When an ASP.NET application is started it processes the web.config file. Doing so it is combined with all web.config files found up in the tree of virtual directories. Suppose I have a website located at www.mikeglaser.com and a w00t app like www.mikeglaser.com/w00t. When the application is loaded by the web server the web.config of the root website is read as well. Even when the physical path does not have a tree structure at all. Luckily it reads the highest file in rang first, so if you want to change settings for the app all settings made in the root are overruled. Things get worse when an ASP.NET 1.1 app enters the stage. This will also try to process all files named web.config up in the virtual directory tree, regardless of their intended framework version. The real bad thing is that ASP.NET does not understand an ASP.NET 2.0 config file. The latter happened to me while installing SharePoint 2007 on a production server running several 1.1 apps.

After searching the Net I ran in some strange post of Microsoft. How to: Modify Configuration Settings for an Application to Coexist with Windows SharePoint Services. This post doesn’t work at all and is intended for WSS v2. However this post is released in the WSS v3 documentation. Shame on you MS.

So it was up to me to solve this problem. I changed the ASP.NET configuration settings to use ASP.NET 2.0 as it ASP.NET version. This way all settings in the web.config of SharePoint are now understood by my w00t app.

The only part left to do is add the lower statements to the web.config of the web application

<trust level="Full" originUrl="" />
<httpModules> 
  <remove name="PublishingHttpModule" /> 
  <add name="Session" 
       type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
<pages enableSessionState="true" />

This way the app will be fully trusted, except sessions and resolve a small error which will be added to the eventlog. For complete details about this error, browse to Unable to connect publishing custom string handler for output caching of Steven Van de Craen

Summary
Maybe it wasn’t a good idea to install SharePoint on a production machine without testing it, but you must dare to live. By the way, SharePoint and all apps works like a charm.

 

4 thoughts on “ASP.NET 1.1 Applications and SharePoint 2007

  1. Enrique Rascón

    My question is... how do you make your applications work if you change their ASP to 2.0... if you change it from 1.1 your application will cease to work because they are from .net 1.1 framework...

    Reply
  2. Enrique,

    Good question. Most of your own apps will continue to work, because ASP.NET 2.0 is almost backwards compatible with ASP.NET 1.1. Still you have to test your complete application if everything works. E.g One of those many ASP.NET 1.1 applications uses Crystal Reports, which doesn't support ASP.NET 2.0. Because of this we have to convert this app to ASP.NET 2.0. So it depends on the app.

    Note: By adding a startup to web.config won't work

    Reply
  3. Carlos Dietrich

    I need some help... I could make my ASP 1.1 and 2.0 coexist with SharePoint, but there is a problem with encoding.
    All international characters like: ç, á, é, â are replaced by a square. I already tried to add a globalization tag to web.config forcing the application to use utf-8 or ISO-8859-1, but it's not working.
    Thank you

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *