Window 7 and WebClient Class
-
I have come across problem for which I'm looking for permanent solution. Some software I'm working needs to have a version checking mechanism for update checking and disabling the installed version if necessary. It was decided to that a server be provided from which a small encrypted xml file is downloaded and checked. I thought, "not too complex with Webclient", simply download the file decrypt and check it and then delete it. If an Exception then status is Unverified. Works file on XP machines when the file is removed from the server the exception happens like expected. On the Windows 7 machine however it continues to succeed and even when the network is disconnected. NO exception is raised. I even took out the try/catch to confirm that - NO crash. If set
client.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
just incase, because I wanted to ensure the file was downloaded every time. It is still coming from somewhere. I'm confused!!!!! If anyone has an idea about this I would be interested in knowing about it.
Happy programming!!
-
I have come across problem for which I'm looking for permanent solution. Some software I'm working needs to have a version checking mechanism for update checking and disabling the installed version if necessary. It was decided to that a server be provided from which a small encrypted xml file is downloaded and checked. I thought, "not too complex with Webclient", simply download the file decrypt and check it and then delete it. If an Exception then status is Unverified. Works file on XP machines when the file is removed from the server the exception happens like expected. On the Windows 7 machine however it continues to succeed and even when the network is disconnected. NO exception is raised. I even took out the try/catch to confirm that - NO crash. If set
client.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
just incase, because I wanted to ensure the file was downloaded every time. It is still coming from somewhere. I'm confused!!!!! If anyone has an idea about this I would be interested in knowing about it.
Happy programming!!
Where should the exception be thrown - in some places and under certain circumstances exceptions get swallowed! E.g. in a Form Load or Shown event when the application is executed from Visual Studio; or possibly also on Win7 64 bit machines with those events.
-
I have come across problem for which I'm looking for permanent solution. Some software I'm working needs to have a version checking mechanism for update checking and disabling the installed version if necessary. It was decided to that a server be provided from which a small encrypted xml file is downloaded and checked. I thought, "not too complex with Webclient", simply download the file decrypt and check it and then delete it. If an Exception then status is Unverified. Works file on XP machines when the file is removed from the server the exception happens like expected. On the Windows 7 machine however it continues to succeed and even when the network is disconnected. NO exception is raised. I even took out the try/catch to confirm that - NO crash. If set
client.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
just incase, because I wanted to ensure the file was downloaded every time. It is still coming from somewhere. I'm confused!!!!! If anyone has an idea about this I would be interested in knowing about it.
Happy programming!!
I think your only recourse is to run it under the debugger and investigate every variable and condition (in the appropriate block of code) until you find the problem.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997 -
I have come across problem for which I'm looking for permanent solution. Some software I'm working needs to have a version checking mechanism for update checking and disabling the installed version if necessary. It was decided to that a server be provided from which a small encrypted xml file is downloaded and checked. I thought, "not too complex with Webclient", simply download the file decrypt and check it and then delete it. If an Exception then status is Unverified. Works file on XP machines when the file is removed from the server the exception happens like expected. On the Windows 7 machine however it continues to succeed and even when the network is disconnected. NO exception is raised. I even took out the try/catch to confirm that - NO crash. If set
client.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
just incase, because I wanted to ensure the file was downloaded every time. It is still coming from somewhere. I'm confused!!!!! If anyone has an idea about this I would be interested in knowing about it.
Happy programming!!
-
Where should the exception be thrown - in some places and under certain circumstances exceptions get swallowed! E.g. in a Form Load or Shown event when the application is executed from Visual Studio; or possibly also on Win7 64 bit machines with those events.
From what I have tracked down, the exception doesn't occur because the 'old' file is actually being served up. It seems that the BranchCache service is being over kind to us and even ignoring the noCacheNoStore request. I shall confirm or otherwise on Tuesday when I'm back at work.
Happy programming!!