Posted By: Daniel Moth | Feb 23rd, 2008 @ 2:09 PM | 9,989 Views | 12 Comments

Author: Hi, I am Daniel Moth Smiley

Introduction: In this 18' video you will learn from scratch how to take advantage of .NET Client Application Services. As usual, the code and links to the documentation are available from my blog.

Video download: For this video, click on the image/button to play the video OR right click and Save As on the same location.

Media Downloads:
Rating:
0
1
This video was great: fast paced yet complete.

I did spend a frustrating hour or so trying to figure out why, when I checked the "Remember Me" checkbox, the next call to Membership.ValidateUser(null, null) would result in an exception:

System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="System.Web.Extensions"
  StackTrace:
       at System.Web.ClientServices.ClientFormsIdentity.GetSecureStringFromString(String password)
       at System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider.ValidateUserCore(String username, String password, Int32 rememberMeInt, Int32& promptCount, Boolean tryToUseLastLoggedInUser)
       at System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider.ValidateUserCore(String username, String password, Int32 rememberMeInt)
       at System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider.ValidateUser(String username, String password)
       at System.Web.Security.Membership.ValidateUser(String username, String password)
       at AppServicesClient.Form1.Form1_Load(Object sender, EventArgs e) in C:\Users\drogers\Documents\Visual Studio 2008\Projects\AppServicesDemo\AppServicesClient\Form1.cs:line 39
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
       at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
       at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
       at System.Windows.Forms.Control.set_Visible(Boolean value)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at AppServicesClient.Program.Main() in C:\Users\drogers\Documents\Visual Studio 2008\Projects\AppServicesDemo\AppServicesClient\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

I found that by replacing the null arguments with string.empty, (Membership.ValidateUser(string.Empty, string.Empty)) the program worked as expected.

Thanks again and ciao,
David

Daniel,

 

How do you deploy the above described service to the IIS?

 

Thanks,

 

Marat

Marat
Marat
Marat

Daniel,

 

What is the proper way to deploy the above service to IIS?

 

Marat

Microsoft Communities