IAuthenticationService exception

Topics: CAB & Smart Client Software Factory
Jul 4, 2006 at 4:22 AM
originally posted by: alexsantos


I'm executing the GlobalBank, so if I `cancel` the logon I receive a exception from Windows and not the normal managed exception.

I have the same problem with any application that raise a exception on IAuthenticationService.Authenticate() method.

Please, can anybody test on your machine about this problem ?

Alexnaldo Santos
Jul 4, 2006 at 6:48 AM
originally posted by: jcelichirigoity

Hi, you can try building and running the application in 'Release' mode. We handle the exception in a different way for 'Debug' and 'Release' mode, so while debugging we have a chance to attach the debugger to the application when an exception occurs.
I think that looking at the RunInReleaseMode() method on ShellApplication may help you.
Jul 6, 2006 at 8:03 AM
originally posted by: alexsantos

In both case the error continue.....
Jul 8, 2006 at 3:14 AM
originally posted by: marianoszklanny

I tried to reproduce the problem but I didn't succeed. Could you please provide more details about the exception being thrown and your environment?

PD: Just to make sure, you are using the June 2006 release, don't you?


Mariano Szklanny
Jul 12, 2006 at 2:15 AM
originally posted by: alexsantos


I'm using June 5th Drop...

To reproduce the problem I simple open the 'GlobalBank.Shell.exe' and click on 'Cancel' on logon form.

In another machine the same error continue...
Jul 12, 2006 at 2:43 AM
originally posted by: marianoszklanny

Could you please post the exception message?
Jul 12, 2006 at 3:10 AM
originally posted by: marianoszklanny

Sorry, I quickly read "June" and I thought of the June latest release :)

Please, try downloading the latest release and let me know if you still have the same problem.
Download: http://www.microsoft.com/downloads/details.aspx?FamilyId=2B6A10F9-8410-4F13-AD53-05A202FBDB63&displaylang=en

Jul 22, 2006 at 8:55 AM
originally posted by: maybede

Sorry I hate hijacking threads but I too am having trouble with the IAuthentication and didn't see why I should start a new thread.

I have had the problem that the original poster is having but I also have a problem when trying to write my own application that uses the IAuthentication interface to show a AuthenticationForm and authenticates the user before the rest of the app fires up.

In SmartClientApplication.cs when adding items to the rootworkitem service when I try to add rootworkitem.servies.addnew<IAuthenticationService>(); I get the exception saying the "A Service of this type already exists" That would be great but I cannot get the functionality that exists in the bank example application to work in my own application. I'm also sure its because I don't understand the software factory well enough yet.

Thanks for any help you could provide.
Jul 22, 2006 at 9:20 AM
originally posted by: maybede

Without the line rootworkitem.servies.addnew<IAuthenticationService>(); in the SmartClientApplication class I go into the WindowsPrincipleAuthenticationService class instead of the SimpleWinFormAuthenticationService class.
Jul 22, 2006 at 12:22 PM
originally posted by: PauloMorgado

CAB starts with WindowsPrincipleAuthenticationService as the implementation of IAuthenticationService. To add a new one, you need to remove the old one first.

To be on the safe side when adding/replacing service implementations, you should always do something like this:

if (workItem.Services.Contains<IService>())

Note: I'm writing this from memory.