InstantKB & IIS7 + Integrated Application Pool


InstantKB Question
I migrated my site to a new server that is using IIS7 and was getting 404s for every sub page I clicked on, obviously suggesting that the URLRewriting wasn't working. I looked at the web.config and noticed that <system.webserver> was essentially empty, so I found this article:

https://kb.instantasp.co.uk/Knowledgebase/Using-InstantKB.NET-2.0-within-an-IIS7-Integrated-Application-Pool?Keywords=IIS7

I used that web.config and updated my connection string and now I get the following error:

NET Runtime version: 2.0.50727.4200Application Domain: 
/LM/W3SVC/11/ROOT-2-129254048952489772Assembly Codebase: 
D:/Inetpub/wwwroot/kb.harrington-group.com/bin/InstantASP.InstantKB.DLLAssembly Full
Name:  InstantASP.InstantKB, Version=2.0.6.0, Culture=neutral,
PublicKeyToken=nullAssembly Version:  2.0.6.0Assembly Build Date:
8/4/2010 10:14:56 AMException Type:   System.NullReferenceExceptionException Message:
 Object reference not set to an instance of an object.Exception Source: 
InstantASP.InstantKBException Target Site: GetCurrentUser---- Stack Trace ----
InstantASP.InstantKB.HttpContext.KnowledgeBaseContext.GetCurrentUser() 

Now, I could have stuck with Classic, but it wasn't even working with that as I was getting 404s. At least with Integrated, it seems to be getting somewhere. I have the source code and can't seem see anything that would be wrong in that GetCurrentUser method.

Have you experienced this before or do you have any suggestions?

The server is x86 Server 2008.
InstantKB Question

Hi there,

Hope your ver ywell. Many thanks for your post. I'm sorry to hear of hte trouble.

I tested the web.config today from that article within an IIS7 Integrated Application Pool and it appears to work for me both logged in and as an anonymous user.

The error your receiveing appears to be around the GetCurrentUser method. This would suggest to me it's related to authentnication.

A few quick things to check.

1. Are you using forms authentication within your web.config...

<authentication mode="Forms">
   <forms name="InstantASP" loginUrl="Logon.aspx" protection="All" slidingExpiration="true" path="/" />
</authentication>

2. Do you have any parent web.config files that could be conflicting with the authentication. For example a parent web.config with the authentication mode set to "Windows" for example.

3. Ensure you include the Security HTTP Module for InstantKB.NET so we can populate the HttpContext objects. For IIS7 this would be...

<system.webServer>
        <modules>
            <add name="EmailModule" type="InstantASP.Common.HttpModule.EmailModule" preCondition="managedHandler" />
            <add name="ExceptionModule" type="InstantASP.Common.HttpModule.ExceptionModule" />
            <add name="SecurityModule" type="InstantASP.Common.HttpModule.SecurityModule" />
            <add name="ServiceModule" type="InstantASP.Common.HttpModule.ServiceModule" />
            <add name="KBServiceModule" type="InstantASP.InstantKB.HttpModule.ServiceModule" />
            <add name="URLRewrittingModule" type="InstantASP.InstantKB.HttpModule.URLRewritterModule" />
        </modules>
 </system.webServer>


If InstantKB.NET is a child of a prent web application you may need to add these settings to your root web.config also.

Please let me know if any of these suggestions help. I look forward to your response and assisting further,

Edit: This issue has since been resolved and newer versions of InstantKB support both classic & integration application pools within IIS.

http://www.instantasp.co.uk/images/line.gif
Kindest Regards,

Ryan Healey



ryan@instantasp.co.uk
www.instantasp.co.uk
Blog | Community | Docs

http://www.instantasp.co.uk/core/assets/images/email/facebook.png http://www.instantasp.co.uk/core/assets/images/email/twitter.png http://www.instantasp.co.uk/core/assets/images/email/google.png http://www.instantasp.co.uk/core/assets/images/email/linkedin.png

Ryan,Thank you for your response. I took the stock web.config for IIS7 as recommended by your team in the following KB article:

https://kb.instantasp.co.uk/Knowledgebase/Using-InstantKB.NET-2.0-within-an-IIS7-Integrated-Application-Pool?Keywords=IIS7

So, I have all of the items configured as you suggested (Forms Authentication, SecurityModule) and the site is it's own separate site with it's own Application Pool. 

I do agree that this is an issue is the GetCurrentUser and seems to be security related, but I'm not exactly sure how or why it's been caused. Do you have any further suggestions? 

Your help is much appreciated! 
GO

Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....







InstantASP Forums


Search