.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

Custom UsernamePasswordValidator causes IIS Application Pool to hang.

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :WCF
I have a WCF service hosted in IIS (IIS 7 with .NET 3.5 SP1) that uses a custom UsernamePasswordValidator to validate message credentials against a database. The problem is that it works for a while, but over a period of time IIS stops responding to all client requests until the application pool is recycled. The IIS worker process has some requests that get stuck in the "AuthenticateRequest" pipeline state of the "ServiceModel" module. In my testing, I can consistantly reproduce the problem by forcing a client to create a new service proxy with a different username and password and calling the WCF service every few seconds. To troubleshoot I created a new project and removed all of the authentication code in the Validate function so that the UsernamePasswordValidator will accept any username and password combination without throwing an exception, but IIS still hangs: namespace WcfTestService { public class CustomValidator : UserNamePasswordValidator { public override void Validate(string userName, string password){//code removed for testing} } } If I remove the ServiceCredentials node from the Service Behavior, IIS doesn't hang anymore, but there is no user validation that takes place either, which is a problem. Here is the service binding configuration: <services> <service name=&

View Complete Post

More Related Resource Links

Enterprise Library: Take Exception To Critical Errors With Custom Application Blocks


Enterprise Library is a collection of application functionality blocks that you can re-use in your application for common functionality you'd otherwise have to write again and again. Here Jay Hilyard explains how to use them.

Jay Hilyard

MSDN Magazine September 2006

.NET Internals: Tailor Your Application by Building a Custom Forms Designer with .NET


The design-time architecture of Windows Forms in the .NET Framework has made development much more flexible than it had been with MFC. With Windows Forms, you can drag one of your custom controls from the toolbox and drop it onto the Visual Studio design surface and even though Windows Forms knows nothing about the control, it's able to host it and let you manipulate its properties-not possible in MFC. In this article, the author discusses what's going on under the covers as you design your forms and then walks through the creation of a bare-bones forms designer.

Sayed Y. Hashimi

MSDN Magazine December 2004

Stress Testing: Custom LoadGenerator Tool Identifies the Issues Your Application Faces Under Stress


It's easy to postpone stress testing when developing an application, and it's easy to forgo it altogether. Having an easy-to-use framework at your fingertips to conduct these tests can make the task far less painful. This article walks you through an application that eases the task of generating load for a variety of layers within an application.

Brian Otto

MSDN Magazine April 2004

Error Handling: Throwing Custom Exception Types from a Managed COM+ Server Application


Exception handling semantics in .NET are based on type, so you can create custom exceptions that have their own properties and methods. In .NET, exceptions are first-class citizens, and since they're the built-in error handling mechanism, all .NET-compliant languages must support exceptions. In addition, COM+ services are available to .NET code as Enterprise Services, so you can leverage exceptions in your Enterprise Services design.In this article the author describes custom exceptions, throwing exceptions across COM interop boundaries, and working with Enterprise Services.

Bob DeRemer

MSDN Magazine March 2004

How to Keep conntion pool and application pool for certain time?


In my current system MOSS and windows 2003, I do not know where to see connection pool live time ? and Application pool live time?

How to keep live these for certain number of hours? Where can I change? Is it possible to keep minimum number of connection pool live always?


Thanks for help in advance.


Managing Custom Configuration Options for a SharePoint Application

Learn how to store configuration data in various ways, including inside the web.config file on front-end Web servers, by using the property bag on various Windows SharePoint Services objects, storing configuration data within SharePoint lists, and by using the hierarchical object storage.

Returning custom error messages with an UserNamePasswordValidator

Ok, my head hurts from banging it against the wall. I'm new to WCF, I have searched for a solution for days, please help a desperate fellow programmer if you can :-( I have a WCF service hosted in IIS, I implemented a UserNamePasswordValidator, and it seems impossible to find a way to return a custom error message to the client when the user is not allowed in, this blows my mind. I have searched everywhere, many are asking the same question since 2006 and so far I haven't found an answer that works. If you are thinking of replying that it is not secure to return a custom error message to an unauthenticated client, please save yourself some time and don't do it. There are multiple enterprise business scenarios that this is required. Just in our organization an account could be locked out, in which case the user must be directed to the IT department to get it unlocked, it could be that the credentials are correct but the user hasn't paid their fees in which case they must be directed to the appropriate department, or it could even be that the user tried to access the service during a time of the day in which the service is not available. From searching around, I have tried doing the things below in the Validate method, however the client always receives a MessageSecurityException, which contains none of the custom messages that were originally thrown, neither in the object,

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

Move custom list (with lookup fields) to another Web Application

Is it possible to move a custom list with lookup fields to other custom lists from one web application to another? Creating list templates does not work and breaks the relationship. Thanks.   Neil

Secure Service Store and custom web application.

 Hello All,  I have a problem for which I would like to use the Secure Service Store.  I've searched for similar solutions involving the SSS but I've not had any success yet.  Maybe I'm missing something obvious or going about it the wrong way.   We have an external application (actually, a number of external applications) we'd like to embed in our SharePoint site using an iframe or the Page Viewer web part.  The embedded application uses a custom forms based authentication scheme and I want to prevent the situation where a user has to log into our application then log into the embedded application.  Is there anything available the help post the credentials from SSS to the custom application?  The only think I can think to do is write some code that mimics a post to the login page of the embedded app and, if needed, write a stripped down or simpler login page for the embedded app to make that easier.  For my immediate task I have quite a bit of control over the source of both application and could write custom code on both sides if I had to, but I'd rather have a solution that only involve configuration or, at most, custom code on the SharePoint side.  Thanks,  Brandon 

Trying to build a custom application to crawl SharePoint Search

Hello,      I have been tasked with building a custom application to develop a report dynamically based upon a search ran in a SharePoint site using user-defined keywords. What I need the application to do is this: 1.) Access the results of a search, and do a full fidelity save of each item. 2.)  If the item returned is a document in a library and it has other versions associated with it, access the meta-data of those other versions and group those results with the item found in the search. 3.) Store the results in XML (probably the easiest), and build a custom display for reporting purposes. If anyone has any advice on how I can accomplish this, I would be very grateful, Thanks!

How provide iView to the custom PHP web application?

We need to integrate custom made PHP application to the SharePoint 2010. How to do? Content Viewer webpart does not allow auyhetication and cookies.  Any help with SSO funtictionality? This is our requirement: 1. User enters to the SharePoint 2010 server portal 2. User open site with somekind of iView webpart 3. User is automatically authenticated and the user views contents of custom PHP portal. About SharePoint: -Intranet/Extranet inside firewall -Users in AD -SSL About external system: -Custom made PHP web application -Server in the different domain outside wirewall -User in the portal user database -User session stored to the Cookies -SSL -Accept authentication with eg.https://your.php.domain/sso.php?logon=encrypted_users_logon_name&api_key=some_tokenKenny_I

How do use an existing application pool when creating a new web application on Moss-2007 SP2

I have been asked to try and reduce how much memory is being used on our Moss 2007 SP2 farm by reusing existing web application pools. My problem is that when you go through creating a new webapplication and choose the option labled "Use existing application pool" under the section labled "Application Pool - Choose the application pool to use for the new web application" I can only select from a list of three application pools "(Default App Pool (network services), Shared Services, and OfficeServerApplicationPool (NetworkService)" The drop down list does not mention any of the other app pools I have created for previous web applications. My question is this, how do I pick an existing web application pool that I have created previously, rather than keep on creating new application pools for every new web application I create? The farm consists of 3 FE servers 1 search, 1 Query and a Clustered 64bit SQL backend running SQL 2005 all running 64bit W2003 server R2 Thanks for any help you can provide on this. Mr T.    MR T

How To Use a Specific Sites' Master Page for my custom asp.net application

I have a custom application that I migrated to sharepoint (compiling into single DLL and creating a fodler for it in the layouts folder in 12 hive) Currently, I am using ~/_layouts/application.master as my masterpage for the custom application. However, i would like to use a certain site's master page for my application versus the default one. For instance, I would like to use the master page from this sub site www.maindomain/sites/subsite/ Thanks for your help.

PowerPivot - New Application Pool vs. Existing Application Pool

When creating a PowerPivot Service Application I am giving two options: "Use existing application pool" or "Create new application pool" and if I join an existing pool which one should it be "SharePoint Web Services Default" or "SharePoint Web Services System"? Now I understand isolation and other technical reasons but what I want to understand is what you guys in the field that run SharePoint Farm would want me to configure and if that does not cause me any scale or performance issue we are good.  If I want to run outside most SharePoint standards I better have a good reason. One note I just missed was: "While this may be a good security best practice, you may still want to use an application pool and/or managed account that is tied to your SharePoint Farm account. As will be noted in Chapter 9, for the PowerPivot data refresh feature to work, the PowerPivot Service Application and PowerPivot System Service requires Farm account rights to access the Secure Store Service database." -- PowerPivot for Excel and SharePoint, page 217 So folks what you would suggest or better yet, how would you like it configured within your farm. Thanks. Denver, CO

Enabling Windows Authentication to SQL Server using Application Pool Credentials

I have created a WCF Service (VS2008), an application pool account which has the access to the SQL Server(in remote machine). Configured the App Pool account to the Virtual Directory in IIS (Version 6.0). Once I browse through the SVC file, I can see the WSDL file. I have the "Windows Authentication" and the 'Anonymous authentication" Checked in the Properties for the Virtual Directory. But when I access service through Client, I get "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.". Binding that is being used is HTTPBinding. I have set the Identity Impersonate to True as well. Bottom line is - I need to use the App Pool account to connect to the SQL Server. Could some one please help me in this?  
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