Why is Visual Studio / CLR creating a "bad" executable?

This is a strange problem that I started recently. My team is developing a COTS application, and we have a few people who own the code. A few weeks ago, I received an error when trying to debug (and run the compiled EXE):

"Windows cannot access the specified device, path or file. You cannot have the appropriate permissions to access the item."

In the end, I had to reorganize this piece of code:

mcolSchedulesNeedingOverride(New Guid(lstrErrorParts(0))) &= vbNewLine & lstrErrorParts(2)

In that:

Dim lguidKey As New Guid(lstrErrorParts(0))
Dim lstrErrorMsg As String = mcolSchedulesNeedingOverride(lguidKey)
lstrErrorMsg &= vbNewLine & lstrErrorParts(2)
mcolSchedulesNeedingOverride(lguidKey) = lstrErrorMsg

This allowed VS to generate an EXE that really worked. I really don't understand why, but it worked. I used the peverify utility to determine which assembly has the problem.

, 25 . - , - , - , .

peverify , , 90 System.Windows.Forms.dll!

- ?

+3
2

, , , , .

, (, , , , , , ), .

, - .NET Framework. , ? , ?

+2

, / . Windows "" .

, ""

, - , ; , ... , , .

: . this kb article "",

0

All Articles