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

Notification

Icon
Error

c# VS2003
mikemikemike
#1 Posted : Monday, October 22, 2007 1:09:24 PM(UTC)
Groups: Member
Joined: 10/22/2007(UTC)
Posts: 2
Location: Italy

I want to record my application in “UltiDev Cassini Web server”, and use the following code:

CassiniConfiguration.ApplicationEntry ccApplicationEntry = new CassiniConfiguration.ApplicationEntry();
CassiniConfiguration.Metabase ccMetabase = new Metabase();

ccApplicationEntry.Port=0;
ccApplicationEntry.Name="MyWsTest";
ccApplicationEntry.KeepRunning = true;
ccApplicationEntry.PhysicalPath = @"D:\My\my sources\MYDOCS\MyWS";
ccApplicationEntry.FrameworkVersion = "1.1";
ccApplicationEntry.Description = "MyWS Test";
ccApplicationEntry.ApplicationID = System.Guid.NewGuid();

int result = ccMetabase.RegisterApplication(ccApplicationEntry);
ccMetabase.Save();


The program writes only the last application, but it cancels the others. Where mistake?


Thanks.
Ultidev Team
#2 Posted : Monday, October 22, 2007 1:32:57 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)
Hi there!

This one is easy. If you are registering only one application, use static form of Metabase.RegisterApplication() method. It automatically loads existing entries and saves everything after registration is done.

Generally you want to get an instance of the Metabase() object only when you register or unregister multiple applications at once - to avoid multiple Load() and Save() calls. In case you need to use instance version of the RegisterApplication() method, you have to start with getting Metabase() instance using factory:
Code:
Metabase ultiDevCassiniMetabase = Metabase.Load();


Best regards,
UltiDev Team.

Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
mikemikemike
#3 Posted : Tuesday, October 23, 2007 2:33:36 AM(UTC)
Groups: Member
Joined: 10/22/2007(UTC)
Posts: 2
Location: Italy

Thanks.
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.