简体   繁体   中英

Visual Basic 2010 crashes when clicking in specific subroutine

When clicking in a specific subroutine in Visual Basic 2010, the application crashes giving only the error message "Microsoft Visual Basic 2010 [Express] has encountered a problem and needs to close."

Nothing appears in the log and safe mode doesn't help.

When I had this problem, I found it was due to a line continuation over 400 lines.

For example:

Dim someString As String
someString = "some text and then a line continuation " & _
             "and then some more text for 400 lines " & _
             ... & _
             "and then finish the string"

To fix it, I just had to make my code a little sloppier by combining multiple "lines" on one line.

Hope this helps someone else!

It sounds like you are clicking on a module or a .vb file in the solution space. Try right clicking, then "edit code" if at all possible. If there is an Interop object, perhaps a control (.OCX) that not's registered ion Windows, then VS will crash -- promise!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM