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

Notification

Icon
Error

Cassini Explorer fails to launch
pbhaskar
#1 Posted : Monday, September 8, 2008 7:20:39 AM(UTC)
Groups: Member
Joined: 7/16/2008(UTC)
Posts: 3

We have a case to deploy Cassini (both Explorer and ASP .NET 2.0 Web Server) with out application and register the application, all done during installation of our application. While we use InstallShield to install our application, we trigger Cassini Explorer and Web Server MSI through our InstallScript.

Adding to this, our Installer class registers our application with Cassini, using .Net reflection. Reflection is employed here, as we cannot reference to CassiniConfiguration assembly both at Compile time and runtime of our Installation.

So the code piece as below.
Assembly cassiniConfigurationAssembly = Assembly.LoadFrom(CASSINI_CONFIGURATION_ASSEMBLY_PATH);
Type metabaseType = cassiniConfigurationAssembly.GetType("CassiniConfiguration.Metabase");

if (metabaseType != null)
{
MethodInfo registerApplicationMethod =
metabaseType.GetMethod("RegisterApplication",
new Type[] { typeof(Guid),
typeof(string),
typeof(string),
typeof(string),
typeof(string),
typeof(bool)});

registerApplicationMethod.Invoke(metabaseType,
new Object[] { new Guid(APPLICATION_GUID),
"Name",
"Description",
"Path",
"Default Document",
true });
}

Considering that we pass proper values to all parameters, our application gets registered to Cassini (i.e. no exception);

We have two different observation here, which are not very consistent but can well be reproduced with little effort.
Observation One - Launch Cassini Explorer, it fails to launch. Perform restart of Cassini Windows Service and re-try to launch Cassini Explorer, it launches and displays our application as a Registered application.

Observation Two - Launch Cassini Explorer, it launches and displays our application as Registered application. Click on the application hyperlink in Cassini Explorer, the application fails to launch. Perform restart of Cassini Windows Service and re-try the operation (click on application hyperlink). Our application launches successfully.

We are very confused with this behavior. See if you can help us.
Ultidev Team
#2 Posted : Monday, September 8, 2008 9:17:41 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)
Greetings!

We don't have an answer, but we should be able to help you troubleshoot the issue.

The best way to see what is going on is to check Windows Event Log (Application) right after you have installed UltiDev Cassini components (Server and Explorer), and then right after your installer invoked RegisterApplication() method. If you see any Error or Warning entries related to UltiDev Cassini, please paste here them so we could take a look. If there are too many of Error entries, please do this: clean up Event Log before trying to reproduce the issue. Run installation, export Event Log as EVT file and email us to get the address where you send the EVT file as an attachment.

Please let us know if you are testing on Vista - installation on Vista has more challenges that XP.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
pbhaskar
#3 Posted : Tuesday, September 9, 2008 8:02:57 PM(UTC)
Groups: Member
Joined: 7/16/2008(UTC)
Posts: 3

Thank you for immediate feedback.

Log information was very usefull. Here is our observation analyzing the Application Event logs, we traced two issues.

Issue 1 (minor);
Sequence of installing Cassini Explorer and Cassini Web Server matters; i.e. consider a machine without Cassini, and observe the following.
Install Cassini Web Server. There is an error log as “Skipped loading application "UltiDev Cassini Web Server Explorer" because its folder "C:\Program Files\UltiDev\Cassini Web Server Explorer" does not exist.”
Install Cassini Explorer. There are information logs as “Cassini service restarts itself due to metabase change.
Metabase Services:
Application: UltiDev Cassini Web Server Explorer, Port: 7756, CLR Version: 1.1”

Looks like a sanity check from Cassini Web Server, but still we have changed the order through our installer, as all Quality gates start complainign while they see 'Error' logs.

Issue 2 (major);
Registering our application with Cassini was done during ‘Install’ event; We opted to choose “Always keep application in memory to improve first page response time ”; this is passed on as a Boolean parameter to RegisterApplication method. As we are still in install phase, its highly possible that our application is yet to be completely deployed. i.e. all applications files are not yet deployed into target machine.

But as we choose to use ‘keepRunning’; Cassini attempts to immediately load the application and results into error (logged) as
“Exception information:
Exception type: ConfigurationErrorsException
Exception message: Could not load file or assembly '***' (removed for privacy reasons) or one of its dependencies. The system cannot find the file specified. (*** (data removed for privacy reasons))

This has been fixed by moving the application registration process from ‘Install’ phase to ‘OnCommitted’ phase. Oncommitted event is raised when all the installer files have completed their operation; it is more towards the very end of an installation. By this time, all our application files will be deployed into the target machine.

Thank you again for the support.
Ultidev Team
#4 Posted : Wednesday, September 10, 2008 6:25:33 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)
Thank you for the feedback.

We are glad you have resolved the issue. Your approach to the second problem is exactly correct. Moving application registration to OnCommit step is precisely what should be done.

Best regards,
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 (8)
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.