This is a weird problem I have started having recently. My team is developing a COTS application and we have a few people with their hands in the code. A few weeks ago, I received an error message when trying to debug (and run the compiled EXE):
"Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item."
It ended up I had to refactor this snippet of code:
mcolSchedulesNeedingOverride(New Guid(lstrErrorParts(0))) &= vbNewLine & lstrErrorParts(2)
In to this:
Dim lguidKey As New Guid(lstrErrorParts(0))
Dim lstrErrorMsg As String = mcolSchedulesNeedingOverride(lguidKey)
lstrErrorMsg &= vbNewLine & lstrErrorParts(2)
mcolSchedulesNeedingOverride(lguidKey) = lstrErrorMsg
That then allowed VS to generate a EXE that actually worked. I really don't understand why, but it worked. I did use the peverify utility to determine which assembly was having an issue.
Now I have the same issue in a different code branch after about 25 files were updated yesterday. This is NOT going to be fun to track down - so I was hoping someone could offer some insight as to why this might be happening - and that might help me narrow down where to look.
peverify shows all our assemblies to be correct, but is spitting back 90+ errors for System.Windows.Forms.dll!
Anybody have any tips?