Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better exception message when trying to access a property of a session that no longer exists #59

Open
GoogleCodeExporter opened this issue Aug 26, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Unable to reproduce, but occurs now and then.

What is the expected result? What happens instead?
Expect to retrieve the list of sessions. Instead it throws an error

What version of Cassia are you using (e.g. 2.0.0.60)?
2.0.0.60

On what Windows version is your code running?
Windows Server 2008 Standard

Is your code running as a Windows service, an ASP.NET application, or a
standalone application?
Running as a Windows Service with SYSTEM account

What Windows version is running on the remote server you are trying to
access (if any)?
Not available

Please provide any additional information below. If you are running into an
exception, please include a stack trace (at least the portion of it that
relates to Cassia).
Stacktrace unavailable.

Original issue reported on code.google.com by whypurpl...@gmail.com on 13 Apr 2012 at 7:52

@GoogleCodeExporter
Copy link
Author

Stack trace: 
System.ComponentModel.Win32Exception: The system cannot find the file specified
   at Cassia.Impl.NativeMethodsHelper.QuerySessionInformation[T](ITerminalServerHandle server, Int32 sessionId, WTS_INFO_CLASS infoClass, ProcessSessionCallback`1 callback)
   at Cassia.Impl.TerminalServicesSession.GetClientIPAddress()
   at Cassia.Impl.LazyLoadedProperty`1.get_Value()
   at Cassia.Impl.TerminalServicesSession.get_ClientIPAddress()
   at windowservice.LogoffHandler.ProcessPostLogoffEvents(Object state)

Original comment by whypurpl...@gmail.com on 13 Apr 2012 at 8:30

@GoogleCodeExporter
Copy link
Author

You'll most often see this exception when you're attempting to access a 
property of a session that no longer exists. Given that you're running some 
logic on session logoff (based on your stack trace), this result is not 
uncommon. The solution would be for you to catch the Win32Exception that is 
thrown and handle it appropriately.

It would be better if the library threw an exception with a more specific error 
message though.

Original comment by danports on 13 Apr 2012 at 1:24

  • Changed title: Better exception message when trying to access a property of a session that no longer exists
  • Changed state: Accepted
  • Added labels: Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect

@GoogleCodeExporter
Copy link
Author

Issue 68 has been merged into this issue.

Original comment by danports on 6 Jun 2013 at 12:39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant