mail-archives/mono-osx/2010-January/002659.html

128 строки
5.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-osx] How to have a running .NET 2.0 application quit automatically when user logs out
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20How%20to%20have%20a%20running%20.NET%202.0%20application%20quit%0A%20automatically%20when%20user%20logs%20out&In-Reply-To=26844444.post%40talk.nabble.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="002666.html">
<LINK REL="Next" HREF="002660.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-osx] How to have a running .NET 2.0 application quit automatically when user logs out</H1>
<B>d_v</B>
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20How%20to%20have%20a%20running%20.NET%202.0%20application%20quit%0A%20automatically%20when%20user%20logs%20out&In-Reply-To=26844444.post%40talk.nabble.com"
TITLE="[Mono-osx] How to have a running .NET 2.0 application quit automatically when user logs out">dan.vandermolen at figpsoft.com
</A><BR>
<I>Thu Jan 7 15:19:09 EST 2010</I>
<P><UL>
<LI>Previous message: <A HREF="002666.html">[Mono-osx] Mono 2.6 and Windows.Forms on MacOSX
</A></li>
<LI>Next message: <A HREF="002660.html">[Mono-osx] [ANN] mcocoa 0.7 and mobjc 0.8
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#2659">[ date ]</a>
<a href="thread.html#2659">[ thread ]</a>
<a href="subject.html#2659">[ subject ]</a>
<a href="author.html#2659">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>
Would love to have some help on this.
Could I offer anyone an incentive?
Thanks,
d_v wrote:
&gt;<i>
</I>&gt;<i> My .NET 2.0 application (compiled with VS 2005.net) has always worked well
</I>&gt;<i> on Mono without too many changes. I have tried all the recent version of
</I>&gt;<i> Mono including 2.6. I have two versions of the application; one is for
</I>&gt;<i> testing so I like to have a GUI.
</I>&gt;<i>
</I>&gt;<i> 1. GUI: For testing I use a visible Windows.Form and I can use the program
</I>&gt;<i> and close the window when done and the application closes. (to be
</I>&gt;<i> expected).
</I>&gt;<i>
</I>&gt;<i> Note: If I try to logout when this is running I get error: &quot;Logout has
</I>&gt;<i> timed out because the application mono failed to quit...&quot;
</I>&gt;<i>
</I>&gt;<i> 2. Deployment: I run mostly the same code but do not open the
</I>&gt;<i> Windows.Form. However if the program is running and I try to Logout of Mac
</I>&gt;<i> OSX it hangs with the same error.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Note: I am running a timer if that is a factor, and if running the GUI,
</I>&gt;<i> the background thread does the work and the GUI thread updates the GUI
</I>&gt;<i> display every 5 seconds based on timer.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Here is how I run the application from the main unit:
</I>&gt;<i>
</I>&gt;<i> if (isDeploy) // if deploying then do not show form
</I>&gt;<i> {
</I>&gt;<i> Application.Run();
</I>&gt;<i> }
</I>&gt;<i> else // do show form
</I>&gt;<i> {
</I>&gt;<i> try
</I>&gt;<i> {
</I>&gt;<i> sMsg = &quot;Error creating Form.&quot;;
</I>&gt;<i> frm1 = new MyForm.Form1();
</I>&gt;<i> sMsg = &quot;Error opening Form with call:
</I>&gt;<i> Application.Run()&quot;;
</I>&gt;<i> Application.Run(frm1);
</I>&gt;<i> }
</I>&gt;<i> if (frm1 != null) // is this necessary in a mono
</I>&gt;<i> crash? It gave me weird errors?
</I>&gt;<i> frm1.Close();
</I>&gt;<i> */
</I>&gt;<i> } // try catch
</I>&gt;<i> }
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> I've tried everything I can think of.
</I>&gt;<i> thanks.
</I>&gt;<i>
</I>
--
View this message in context: <A HREF="http://old.nabble.com/How-to-have-a-running-.NET-2.0-application-quit-automatically-when-user-logs-out-tp26844444p27066354.html">http://old.nabble.com/How-to-have-a-running-.NET-2.0-application-quit-automatically-when-user-logs-out-tp26844444p27066354.html</A>
Sent from the Mono - OSX mailing list archive at Nabble.com.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="002666.html">[Mono-osx] Mono 2.6 and Windows.Forms on MacOSX
</A></li>
<LI>Next message: <A HREF="002660.html">[Mono-osx] [ANN] mcocoa 0.7 and mobjc 0.8
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#2659">[ date ]</a>
<a href="thread.html#2659">[ thread ]</a>
<a href="subject.html#2659">[ subject ]</a>
<a href="author.html#2659">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx">More information about the Mono-osx
mailing list</a><br>
</body></html>