Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

Errors when changing target framework?

$
0
0
I have a piece of code: It is to kill a process.
Code:

Dim num As Integer = 1

        Do Until num = 5

            Dim proc = Process.GetProcessesByName("notepad")
            For i As Integer = 0 To proc.Count - 1
                proc(i).CloseMainWindow()
            Next i


            num = num + 1

            If num = 5 Then
                num = 3
            End If

        Loop

It was working fine when i first started on my project on framework 4.5. Then i switched target framework to 2.0 and i got an error:


I tested it and it seems that it only works on frame work 3.5 +

How can i fix this error? I cant afford to have framework 4.5 dependency on my programs.

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>