Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

WaitForAppToStart function
PierreXPT
#1 Posted : Friday, March 2, 2012 9:36:54 AM(UTC)
Groups: Member
Joined: 2/14/2012(UTC)
Posts: 4
Location: France

Hi,

I'm trying to use the public static bool WaitForAppToStart(Guid appID, int timeoutMilliseconds) function in my C# Winform project.
I never get a true as a response !
What is the best way to use this function

Here is a sample of my code :
_appEntry = UWS.Configuration.Metabase.GetWebAppEntry(_appGuid);
_appEntry.AppType = UWS.Configuration.ApplicationType.AspNetOrStaticHtml;
_appEntry.ApplicationName = "XXXXXXXXXX";
_appEntry.ApplicationDescription = "";
_appEntry.PhysicalDirectory = _appPath;
_appEntry.DefaultDocument = "default.aspx";
_appEntry.VirtualDirectory = "/";
_appEntry.ListenAddresses.Clear();
UWS.Configuration.ListenAddress listenAddress = new UWS.Configuration.ListenAddress((ushort)_appPort);
_appEntry.ListenAddresses.Add(listenAddress);
UWS.Configuration.Metabase.RegisterApplication(UWS.Configuration.RuntimeVersion.AspNet_1_2or3x, true, true, UWS.Framework.ProcessIdentity.LocalSystem, _appEntry);
return (UWS.Configuration.Metabase.WaitForAppToStart(_appGuid, 5000));

Thanks in advance for any answers !

Regards
Ultidev Team
#2 Posted : Friday, March 2, 2012 9:55:38 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi!

5000 millisecond timeout could be be too short - after application is registered it may take longer time to come online. WaitForAppToStart() method pings the application periodically (you could see it in Fiddler) and does not let up while it's getting one of the 5xx return codes. If you set delay parameter to -1, then WaitForAppToStart() will keep trying indefinitely. In reality, to build an installer that will not block installation forever in case of failure, please consider setting timeout to about 60000, to give it a minute before it gives up. If you see in Fiddler that WaitForAppToStart() does not return true even after application starts returning non-5xx responses, please let us know, we'll investigate further.

After you make this work, if you are trying to launch the application the a browser, please consider using LaunchTheAppInTheBrowser() method instead of WaitForAppToStart().

Also, just FYI, API's application registration methods now facilitate creation of application desktop shortcuts.

Please let us know if this information was helpful.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
PierreXPT
#3 Posted : Friday, March 2, 2012 10:06:42 AM(UTC)
Groups: Member
Joined: 2/14/2012(UTC)
Posts: 4
Location: France

In fact, the web browser is included in my Winform and I just want to wait that the application is online and reachable before going further.
Trying with 60000 makes it work anyway...

Thanks
Ultidev Team
#4 Posted : Friday, March 2, 2012 11:29:00 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
We are happy we were able to help!

Cheers,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.