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

Notification

Icon
Error

Registration of multiple web apps in single installer
Guest
#1 Posted : Monday, July 16, 2012 11:29:52 PM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

Hi,

I've developed a VS2010 Setup Project to install and register two related ASP.NET 4.0 web applications.

When I run the setup on a Windows 7 Ultimate 64 bit virtual machine, the install works fine, and one of the web apps registers successfully.

But the second web app fails to register with a System.IO.IOException: The system cannot access the file "C:\Program Files\UltiDev\Web Server\UWS.Configuration.xml" because it is being used by another process.

If I subsequently run a Repair, using the same installer, the second web app then gets registered OK.

Can you advise the best way of dealing with this issue? I want to install both web apps in the same installation package if at all possible.

TIA
Ultidev Team
#2 Posted : Tuesday, July 17, 2012 10:15:51 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)
Hi there!

To help you with this we'd like to ask you a few things:

- Are you using UWS.RegApp.exe to register the application or UWS Config API?
- After you get an error, can you open UWS Explorer and save configuration for any existing or new application? Do you get the same error by any chance?

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#3 Posted : Tuesday, July 17, 2012 5:26:12 PM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

Thanks for the reply.

I'm using UWS.RegApp.exe to register both applications via custom actions in the installer.

I am able to save the configuration for the application that does get registered without any apparent error.

The error dialog does not come up every time, but if UWS Web Explorer is open you can see UWS try to register the second app, but then the icon goes red and it disappears again.

It does not seem to make a difference if I reverse the order of the custom actions.

TIA
Ultidev Team
#4 Posted : Wednesday, July 18, 2012 8:28:51 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)
Hi there!

We will re-test this scenario. If there is a race condition, while UWS file is locked and other things like listen endpoint creation is in progress, then you may need to introduce a delay and/or add custom action code to check whether UWS web server config file, "UWS.Configuration.xml", is not locked.

If we can fix it by delaying registration until it can proceed, we'll add it to the next release.

We'll let you know in a few days what we have found.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Ultidev Team
#5 Posted : Wednesday, July 18, 2012 10:58:13 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)
Hi again.

While reviewing this issue, we have realized that "C:\Program Files\UltiDev\Web Server\UWS.Configuration.xml" is an incorrect path to the config file. It should be "C:\ProgramData\UltiDev\WebServer\UWS.Configuration.xml".

Could you please check Windows Event log, where exception stack trace could be captured. We would definitely like to see the part where our system is looking for the file in a wrong location.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#6 Posted : Wednesday, July 18, 2012 6:34:14 PM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

Sorry, my mistake, the C:\Program Files\... path I quoted was incorrect. I transposed it (badly) from the messagebox that came up. I apologise!

Here is the Event log entry:

Failed to register or unregister application due to
"System.ApplicationException: Failed to save application configuration from "C:\ProgramData\UltiDev\WebServer\UWS.Configuration.xml". Error: The process cannot access the file 'C:\ProgramData\UltiDev\WebServer\UWS.Configuration.xml' because it is being used by another process. ---> System.IO.IOException: The process cannot access the file 'C:\ProgramData\UltiDev\WebServer\UWS.Configuration.xml' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.IO.File.Open(String path, FileMode mode, FileAccess access)
at UltiDev.Framework.XmlSerializationHelper.XmlSerializeToFile(Object data, String filePath)
at UWS.Configuration.Metabase.SaveMetabase(MetabaseSerializationHelper mb)
--- End of inner exception stack trace ---
at UWS.Configuration.Metabase.SaveMetabase(MetabaseSerializationHelper mb)
at UWS.Configuration.Metabase.RegisterApplicationInternal(HostProcessConfigEntry hostProcess, WebAppConfigEntry application, ICollection`1 shortcuts)
at UWS.Configuration.Metabase.RegisterApplicationWith(HostProcessClrAndBitness hostType, Boolean useDefaultSharedHostProcess, ProcessIdentity processIdentity, WebAppConfigEntry application, ICollection`1 shortcuts)
at UWS.Configuration.Metabase.RegisterApplication(RuntimeVersion aspNetVersion, Boolean run32bitOnx64, Boolean useDefaultSharedHostProcess, ProcessIdentity processIdentity, WebAppConfigEntry application, ICollection`1 shortcuts)
at UWS.RegApp.Program.DoIt(Dictionary`2& pBag)
at UWS.RegApp.Program.Main(String[] args)".

Command line:
"C:\Program Files (x86)\UltiDev\Web Server\UWS.RegApp.exe" /r /AppID={AC93FAEA-0192-4D52-861A-A91F664FA3FB} /aspnet:4 /vdir:WS "/path:C:\Program Files\ACHS\EAT5_NS\\EAT5_NS\WS"

The parameters for Starter.exe I use in the custom action are:

"[ProgramFilesFolder]\UltiDev\Web Server\UWS.RegApp.exe" /r /AppID="{AC93FAEA-0192-4D52-861A-A91F664FA3FB}" /aspnet:4 /vdir:WS /path:"[TARGETDIR]\EAT5_NS\WS"

It seems a bit strange that the Event viewer command line ends up with a double backslash in it, but as stated earlier this application registers perfectly if I run a repair after the initial installation, so this seems unlikely to be a significant issue.
Ultidev Team
#7 Posted : Thursday, July 19, 2012 10:11:26 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)
Hi there!

We will retest scenario where two application registrations are done close to each other. If this ends up being an improperly-handled race condition, we'll fix it in the next release. We'll post here soon to let you know whether we were able to reproduce the problem. Meanwhile please consider adding a delay between two registrations. It will not make this 100% reliable, but 10 second delay may make this problem go away for 99% cases. We'll work on this and will keep you posted.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#8 Posted : Thursday, July 19, 2012 5:02:50 PM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

Thanks, I figured I'd probably be able to workaround the problem with some sort of delay. I'll proceed on that basis for now.

Cheers
Guest
#9 Posted : Thursday, July 19, 2012 6:32:45 PM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

Hi there,

Introducing a ten second delay between registrations seems to have fixed the problem. Both apps are getting registered now with no problems.

Thank you very much.
Ultidev Team
#10 Posted : Friday, July 20, 2012 8:28:03 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)
Hi!

Not a problem at all. Thank you much for bringing this problem to our attention.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Ultidev Team
#11 Posted : Sunday, August 5, 2012 5:26: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)
Hello!

We added access synchronization to the UWS metabase file, with timeout of up to 5 seconds. This should resolve the issue. The change will appear in UWS build 18. If you are interested in testing a pre-release build with this feature, please let us know. The best way would be registering an account with this forum and posting to request the pre-release. We then will respond by email with the link to UWS pre-release build 18.

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 (3)
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.