Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > IsNetworkDeployed throws DeploymentException: Lock timeout exception.
 

IsNetworkDeployed throws DeploymentException: Lock timeout exception.

Very simple WinForms application, deployment manifest specifies to check for updates "After the application starts" every 4 days.

The load event of the form wants to know ifCurrentDeployment.IsFirstRun -- so it starts with a check of

System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed

which (after a long pause) throws:

System.Deployment.Application.DeploymentException: Lock timeout exception.
at System.Deployment.Application.LockedFile.AcquireLock(String path, TimeSpan timeout, Boolean writer)
at System.Deployment.Application.SubscriptionStore.AcquireLock(DefinitionIdentity asmId, Boolean writer)
at System.Deployment.Application.SubscriptionStore..ctor(String deployPath, String tempPath, ComponentStoreType storeType)
at System.Deployment.Application.SubscriptionStore.get_CurrentUser()
at System.Deployment.Application.ApplicationDeployment..ctor(String fullAppId)
at System.Deployment.Application.ApplicationDeployment.get_CurrentDeployment()
at System.Deployment.Application.ApplicationDeployment.get_IsNetworkDeployed()
at sfSiteTool.frmSiteTool.frmSiteTool_Load(Object sender, EventArgs e)

Of course, I willtrap this error ...but what is causing the lock exception?

Stan York  Monday, June 02, 2008 6:24 PM

That could be. I don't think it locks the deployment files while one person is installing, or anything like that, but you could try testing for that by installing it on two computers simultaneously. That would be downright stupid, and you know MSFT would never do anything that dumb. Well, intentionally anyway.

Does it happen all the time, or is it intermittent?

[edit] It doesn't make sense to die on checking IsNetworkDeployed; that's a local check to see if you're running the exe, or running as ClickOnce. It's definitely weird. If you deploy it from your localhost, does it do the same thing?

RobinS.

GoldMail.com

RobinDotNet  Thursday, June 05, 2008 9:10 PM

Hi,

I am not sure but this error might be due to a network problem where its trying to compare the current version at the client to the version at the server and due to the longer waiting time or a network delay , may be its throwing a timeout exception.

subhanet  Thursday, June 05, 2008 6:45 AM

That could be. I don't think it locks the deployment files while one person is installing, or anything like that, but you could try testing for that by installing it on two computers simultaneously. That would be downright stupid, and you know MSFT would never do anything that dumb. Well, intentionally anyway.

Does it happen all the time, or is it intermittent?

[edit] It doesn't make sense to die on checking IsNetworkDeployed; that's a local check to see if you're running the exe, or running as ClickOnce. It's definitely weird. If you deploy it from your localhost, does it do the same thing?

RobinS.

GoldMail.com

RobinDotNet  Thursday, June 05, 2008 9:10 PM

Thanks for your input, folks.

This timeout problem occurred every time the application was started - but only on a single Windows 2003 system.

I do not believe the problem had anything to do with the deployment server - it was local to the system.

I totally agree that it makes no sense for there to be such an exception in IsNetworkDeployed, which is why I brought this up.

Once I had a new version with additional code to catch the timeout, I had to take steps to blow away the bad version -- the error has not occurred since reinstalling (via ClickOnce) the new version. The additional code to catch the error has *not* be excercised.

Whatever this problem was, it seems to have been some sort of"bad install".

Stan York  Friday, June 06, 2008 12:27 PM

You can use google to search for other answers

Custom Search

More Threads

• "Do you want to run the application?" message...
• mysql driver and clickonce
• VS 2005 Setup & Deployment - Condition Question
• Embedding a word Window in VB.NET word app
• cannot deploy application using clickonce within new dll
• Using Clickonce to install MSI?
• Click Once deploy is too big
• Install MSDE as a part of setup?
• How to Deploying to a website
• MSXML4 Prerequisite - How to create Product/Package manifests?