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

Notification

Icon
Error

Configure an app from vb.net 201
Guest
#1 Posted : Friday, September 27, 2013 4:16:10 PM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

What's the problem with RawAddress property?
The .net exception that's appears is: "*" is not a valid listen endpoint address.
But in GUI configuration with UltiDev Web App Explorer the property has specified by an "*" and it work.

Here is my VB.Net code:

Dim MyGuid As System.Guid = System.Guid.NewGuid
Dim WebApp As WebAppConfigEntry = Metabase.GetWebAppEntry(MyGuid, True)
Dim PageList As UWS.Configuration.ListenAddress
Dim FreePort As UShort

WebApp.AllowDirectoryListing = False
WebApp.ApplicationName = "MyApp"
WebApp.AppType = ApplicationType.AspNetOrStaticHtml
WebApp.AuthenicationMode = Net.AuthenticationSchemes.Anonymous
WebApp.BypassAppServerForStaticContent = True
WebApp.DefaultDocument = ""
WebApp.PhysicalDirectory = "C:\MyAppFolder"
WebApp.VirtualDirectory = "MyAppVirutalDir"

WebApp.ListenAddresses.Clear()
FreePort = UWS.Framework.SystemUtilites.FindFreeTcpPort()
Msje(FreePort)
PageList = New UWS.Configuration.ListenAddress
PageList.SystemAssignedPort = FreePort
PageList.RawAddress = "*"
WebApp.ListenAddresses.Add(PageList)

Metabase.RegisterApplication(RuntimeVersion.AspNet_4, True, WebApp)

How can i do it work?
Sorry for my english, my native language is spanish.
Thank you very much!
Ultidev Team
#2 Posted : Friday, September 27, 2013 5:07:54 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!

It appears that by calling FindFreeTcpPort() and then attempting to set RawAddress = "*", you simply want to put the application on any free port and all IP addresses of the target system. If that's the case, you don't need the block of code that starts with WebApp.ListenAddresses.Clear() and ends with WebApp.ListenAddresses.Clear() - you may simply comment it out and that's it. If you are sure you need to specify listen addresses explicitly, you'll need to instantiate ListenAddress likes shown here or here.

Also, you don't have to specify all fields of the WebAppConfigEntry explicitly: simply examine in the debugger what values are after you have instantiated WebAppConfigEntry class and you will see that AppType, BypassAppServerForStaticContent, and others are already set. We suggest starting with specifying only application and and physical location first, and register the app. If you don't like the outcome, make changes then, but in most cases you need to set only a few fields - the rest are set by default.

Also, generating a new Guid before registering an application is not a good idea. The guid for your product line should remain constant. This will let you re-register application without having to unregister the old version first. Consider running GuidGen program and creating a constant Guid for the application. Even when you release upgrade versions of your application, your application Guid should stay the same.

Finally, if you are writing an application installer, you are almost certainly are better off using command line registration utility instead of the configuration API.

For more information be sure to check out our application registration help articles.

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.
1 user thanked Ultidev Team for this useful post.
dacunha121 on 10/4/2013(UTC)
Guest
#3 Posted : Monday, September 30, 2013 11:54:59 AM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

Thank you very much, the problem could be solved.
Ultidev Team
#4 Posted : Monday, September 30, 2013 1:07:15 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)
Great!

Thank you for using UWS products.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
1 user thanked Ultidev Team for this useful post.
dacunha121 on 10/4/2013(UTC)
Guest
#5 Posted : Friday, March 30, 2018 9:00:44 PM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

Message was deleted by a Moderator.
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.