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

Notification

Icon
Error

Default Document
nsleigh
#1 Posted : Thursday, June 14, 2007 8:29:04 AM(UTC)
Groups: Member
Joined: 6/14/2007(UTC)
Posts: 8
Location: UK

According to the documentation the <defaultDocument> is optional when calling UltiDevCassinWebServer2.exe but I am finding the default document is being set to webform1.aspx if this parameter is missing - is this to be expected or am I doing something wrong?

Neil
Ultidev Team
#2 Posted : Thursday, June 14, 2007 6:08:44 PM(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)
Neil,

We've just verified that if you run UltiDevCassinWebServer2.exe as an EXE with command line parameters, and you don't supply default document file name, Cassini will look for common default documents, like index.htm, default.aspx, WebForm1.aspx, etc., and if it finds one, the URL in the browser's Address line will not show the file name - it will only be http://host:port/. Here is the example we've tested (the application has WebForm1.aspx file):
- A command line:
Code:
C:\>"%ProgramFiles%\UltiDev\Cassini Web Server for ASP.NET 2.0\UltiDevCassinWebServer2.exe" /run "C:\NoIISWebAppSetup\"


- The URL in the browser:
Code:
http://127.0.0.1:51846/


Please let us know if this information has helped.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
nsleigh
#3 Posted : Thursday, June 14, 2007 10:26:07 PM(UTC)
Groups: Member
Joined: 6/14/2007(UTC)
Posts: 8
Location: UK

I think I may be misunderstanding how this works. If you don't supply the default then the metabase contains WebForm1.aspx as the default. If that is not the default page for your application then browsing to http://localhost:port returns page not found, I would expect it to open default.aspx (or index.htm).

Neil
Ultidev Team
#4 Posted : Friday, June 15, 2007 5:10:34 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)
Hello, Neil.

We think you've just found a bug. It looks like calling UltiDevCassinWebServer2.exe with /register parameter and default document parameter omitted causes registration WebForm1.aspx as a default document. We'll definitely fix this issue in the next build.

The good news is that there is an easy workaround. When you register an application simply supply the default document file name parameter, and whatever the file name is, this will allow you to request http://host:port/ without having to do http://host:port/document.ext URLs.

Please let us know if this information has helped.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
nsleigh
#5 Posted : Friday, June 15, 2007 7:46:07 AM(UTC)
Groups: Member
Joined: 6/14/2007(UTC)
Posts: 8
Location: UK

Thanks for the update, that is a reasonable workaround but doesn't quite give the flexibility I require so I may have to edit the metabase xml.

Neil
Ultidev Team
#6 Posted : Friday, June 15, 2007 10:48:37 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)
Neil,

if you could describe your use case we probably could help finding the best solution.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
nsleigh
#7 Posted : Friday, June 15, 2007 11:55:43 PM(UTC)
Groups: Member
Joined: 6/14/2007(UTC)
Posts: 8
Location: UK

I am responible for builds and install packs and I wanted to give the devs a web server that "just worked" to that end I was hoping not to have to stipulate the start page. In reality it is not a big problem as by the time the application actually ships the start page will be known.

Neil
Ultidev Team
#8 Posted : Saturday, June 16, 2007 5:02:55 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)
Neil,

if you need to change metabase file, consider using Cassini configuration .NET API we created specifically for that purpose. To use it you will need to add a reference to the UltiDevCassiniServerConfiguration.dll file located in "%ProgramFiles%\UltiDev\Cassini Web Server for ASP.NET 2.0" folder on the 32-bit systems.

Typical usage of the API looks like this:
Code:
using CassiniConfiguration;

public void ChangeDefaultDocument(Guid applicationID, string defaultDocFielName)
{
Metabase ultiDevCassiniMetabase = Metabase.Load();
ApplicationEntry appInfo = ultiDevCassiniMetabase.FindApplication(applicationID);
appInfo.DefaultDocument = defaultDocFielName;
ultiDevCassiniMetabase.Save();
}

This API can also be used to register and unregister applications with UltiDev Cassini, and is used internally by all Cassini components to retrieve or update application configuration information.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
nsleigh
#9 Posted : Saturday, June 16, 2007 5:36:39 AM(UTC)
Groups: Member
Joined: 6/14/2007(UTC)
Posts: 8
Location: UK

Thanks for code but I try to avoid managed code custom actions in my installer (see here for reasons http://robmensching.com/...-the-way-and-heres.aspx). I know Microsft do it and you do with the installer class code but it is not something I am about to start.

Thanks anyway.

Neil
Rss Feed  Atom Feed
Users browsing this topic
Guest (2)
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.