Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I know that this has been posted before, but I think I have read most of them. My situation is different. I just started a project and don't think I have any code that would cause this problem. I'm using 4.6 .net framework. I think the issue is in the compiler itself. I get this error when trying to compile. Also, I've tried other versions of the .net framework. The exception error is: an unhandled exception of type 'System.AccessViolationException' occurred in System.Windows.Forms.dll

Public Class Form1

    Private Sub CryButton_Click(sender As Object, e As EventArgs) Handles CryButton.Click
        Application.Exit()
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
       
    End Sub

    Private Sub CryButton1_Click(sender As Object, e As EventArgs) Handles CryButton1.Click
        Try
            blist.Items.Add("This is a test of a longer string!")
            blist.Items.Add("This is a test of a longer string!")
            blist.Items.Add("This is a test of a longer string!")
            blist.Items.Add("This is a test of a longer string!")
            blist.Items.Add("This is a test of a longer string!")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class

As you can see, I have almost no code and I'm getting this error. I've unchecked "suppress jit" and other things that I've read from this site. Does anyone have any idea why this is happening?
Posted
Updated 16-Oct-15 5:07am
v10
Comments
jumper77 15-Oct-15 17:42pm    
Thought of something else that might help. I'm using Visual Studio 2015 community edition and my OS is a clean install of Windows 10 (not an upgrade).
phil.o 16-Oct-15 11:07am    
Which line does throw the exception?
ZurdoDev 16-Oct-15 11:07am    
Does the error give a stack trace of point to a line of code?
jumper77 16-Oct-15 11:11am    
That's the problem. It never takes me to a line that might be causing me a problem. Also,it happens randomly when I click the start button to run the code. It will run fine for about 6 times, then I will get the exception for two or three times.
jumper77 16-Oct-15 11:30am    
Missed your last comment. It never gives a stack trace when the error occurs.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900