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.