.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

ContextUser null on classic pool with IIS7

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :ASP.Net

I set impersonation and windows on my IIS7.

But when I log on and I get an error my user context is null. I'd rather keep it on a classic pool to keep the users working on the site until I can make a full move to integration.

Anyone know what I need to do to get the HttpContext.Current.User equal to the autenticated user?

Here's a snipper from the event viewer

User host address: ::1
    Is authenticated: False
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
    Thread ID: 8
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False

Shows it's not impersonating event through I set the value.

Any help appreciated


View Complete Post

More Related Resource Links

BuildManager.GetType returns null until application pool recycles

Our application uses the Enterprise Library's PropertyProxyValidator class to validate user input (v4.1 - Oct 2008).  On occassion, the code will raise an exception saying the source type cannot be found.  This error persists until the application pools recycle at night, at which point everything works again.  It tends to only affect one of the web front ends at a time (there are two). I tracked down where the exception was being raised, and this is the section of code:Type IValidationIntegrationProxy.ValidatedType { get { if (string.IsNullOrEmpty(this.sourceTypeName)) { throw new InvalidOperationException(Resources.ExceptionNullSourceTypeName); } Type validatedType = BuildManager.GetType(this.SourceTypeName, false, false); if (validatedType == null) { throw new InvalidOperationException( string.Format(CultureInfo.CurrentUICulture, Resources.ExceptionInvalidSourceTypeName, this.sourceTypeName)); } return validatedType; } } (As you can see, the value for this.SourceTypeName is shown in the exception and I've checked that it matches exactly.) We have never been able to reproduce this exception and at this point don't have any ideas left as far as causes.  For a while, my suspicion was that it was related to the Temporary ASP.NET Files folder.  The last

Use specific pool for WCF in IIS7.0 asp.net hosting



I have a Web site on WS2008 and IIS7.
This web site has got a default pool, ASP.NET pages and WCF services with aspnet compatibility.
I need to have a specific pool for one WCF service.
I don't know if it is possible and if yes how ?

Thank you for your help or advice.

Best Regards,


Pocket TV Classic

PocketTV Classic is a Free software application that allows you to playback the common standard MPEG-1( .mpg) files on your Windows Mobile Pocket PC or other smartdevice. It is optimized to make use of the latest video acceleration hardware "2700G, ATI" and can playback videos in VGA resolution on VGA Pocket PC's I.E. Axim x51v/x50v, iPaq hx4700, Toshiba e800. A great tool to add to anyones collection.

How to check for null/empty strings on dynamic objects?


What is the proper way to check for null or empty strings on dynamic objects? This is the only solution I've found so far:

if (admin.PasswordHash.GetType() == typeof(DBNull) || admin.PasswordHash == string.Empty)

If the field is null, the object returned is DBNull.Value, but if the field is empty string, it's return as a System.String object. This makes it impossible to do regular "admin.PasswordHash == DBNull.Value" check, as that will fail whenever the field has been set to empty string. Is my example the right (and only) way to go?

Users getting logged out because HttpContext.Current is null


We've  been trying to fix this one for a couple years, and I'm just out of ideas, so any help is really appreciated!

We've got a fairly large, complex web application that uses Forms Authentication to authenticate users.  Throughout the application we store and retrieve information about users in the Session object, and in some cases in cookies.  In a couple places we check for the existence of the context, and if it's null we send the user back to the login page to re-establish the session. 

Just a quick run-down of this web app: C#, .NET 3.5, IIS 6, ASP.NET State Service to manage session

As for the session timer, we use our own home-grown timer, which is basically a client-side timer, which is backed up by a check to the SQL database to see when their last activity was.  This seems to work well for us.  It's not perfect, but it allows us to notify the user before the session times out, and allows us to be certain we're not logging a user out before their 60 minutes of inactivity is up.

What's happening is that certain users are being logged out after just a few minutes.  We've eliminated the timer as a cause and believe what's happening is the HttpContext.Current is null, so the user is logged out.  We do not know why the HttpContext.Current is null, and I underst

Adding .net to classic asp


we have a classic asp site, which i'm adding all theses different mods to.
i really want to slowly move to .net, 
is it possible to keep the old base site in classic asp, and build up on it with .net?

Split URL/Path in Classic AND .net 2.0


I need to be able to get the different parts of the URI (and convert from/to relative page paths) in BOTH classic ASP and .Net 2.0 (VB).

For example, if I have "http://sitename.company.com/index.aspx?sec=fred&pag=dis&mode=1" OR "/index.aspx?sec=fred&pag=dis&mode=1"

IS there a function where I can pass in either string (assuming I'm on sitename.company.com) and get back an array with:

(0): sitename.company.com
(1): index.aspx
(2): sec=fred&pag=dis&mode=1

(Or, alternately, three different functions that would return the three parts?)


Integrating aspx page in classic asp web application



I have a classic asp web  application. I am trying to add an aspx(C#) page to the existing asp application.

The existing asp pages have include pages for header and footer. How to add the classic asp include files in aspx page.

Also, How to deploy the aspx page in the existing classic asp web application.

Thank you

Changing classic asp.net Menu to CssAdapterMenu


Hello Friends,

                     I have been using asp.net menu control that is programmatically binded at runtime and has n child node levels. Now i want to use CssAdapterMenu instead because the menu control contains more than 1000 menuItems(in the near future it can also be more 2000 menuItems) and has very slow response in IE 6 or IE 7.

                    Now my question is how should i change the classic asp.net menu to CssAdapterMenu. What should be the steps? Any samples example of n child node levels would be helpful


'element.className' is null or not an object



I just downloaded the project, compiled it and ran it right out of the box and when I put the mouse pointer over or remove the mouse pointer from either MenuItem in the menu demo, I generate this error:

'element.className' is null or not an object

It points to this javascript method:

updateClassName: function(operation, element, name, value) {
        this[operation + 'String'](
                function() {
                    return element.className;
                function(newValue) {
                    element.className = newValue;

Extreme ASP.NET: Search Engine Optimization with ASP.NET 4.0, Visual Studio 2010 and IIS7


In this article, the author takes a look at SEO practices that the reader can apply when using the latest Microsoft Web technologies.

Scott Allen

MSDN Magazine September 2009

Pooled Threads: Improve Scalability With New Thread Pool APIs


The new threadpool APIs in Windows Vista and in the upcoming Windows Server 2008 provide advances that even native Windows developers can benefit from.

Robert Saccone

MSDN Magazine October 2007

.NET Column: The CLR's Thread Pool


How does the thread pool work in the CLR?

Jeffrey Richter

MSDN Magazine June 2003

Page.FindControl Causing Null Reference Exception


Hi guys,

I developed a page in VWD 2008 and it works perfectly locally, but when I deployed it on the server every Page.FindControl() call is causing the NullReference Exception "Object reference not set to an instance of an object. " Can anyone help me out? Code is below


Mike Marshall

            For i As Integer = 1 To 10
                If (CType(Page.FindControl("last_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("first_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("dob_" & i), TextBox).Text.Length > 0) Then
                    Dim person_entry(7) As String
                    person_entry(0) = info_list.Count - 1
                    person_entry(1) = CType(Page.FindControl("last_" & i), TextBox).Text
                    person_entry(2) = CType(Page.FindControl("first_" & i), TextBox).Text
                    person_entry(3) = CType(Page.FindControl("dob_" & i), TextBox).Text
                    person_entry(4) = CType(Page.FindControl("appear_" & i), TextBox).Text
                    person_entry(5) = CType(Page.FindControl("mental_" & i), TextBox).Text
                    person_entry(6) = CType(Page.FindControl("behave_" & i), TextB
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend