Can't reference system.drawing.dll plz help me : 
When I create the code that continuously executes the function, it works normally for 4 minutes, but the error "Can not reference system.drawing.dll" appears and it can not be executed.
I've tried Googleing a couple of times to solve it, but I have not had the same experience with you.
Try writing a Google translation and ask a question.
Code Admins Please help me.




      public static Bitmap GetScreenshot(IntPtr hwnd)
            {
                

                RECT rc;
                GetWindowRect(new HandleRef(null, hwnd), out rc);
    
                Bitmap bmp = new Bitmap(rc.Right - rc.Left, rc.Bottom - rc.Top, 
    PixelFormat.Format32bppArgb);
                Graphics gfxBmp = Graphics.FromImage(bmp);
                IntPtr hdcBitmap;
                try
                {
                    hdcBitmap = gfxBmp.GetHdc();
                }
                catch
                {
                    return null;
                }
                bool succeeded = PrintWindow(hwnd, hdcBitmap, 0x3);
                gfxBmp.ReleaseHdc(hdcBitmap);
                if (!succeeded)
                {
                    gfxBmp.FillRectangle(new SolidBrush(Color.Gray), new 
    Rectangle(Point.Empty, bmp.Size));
                }
                IntPtr hRgn = CreateRectRgn(0, 0, 0, 0);
                GetWindowRgn(hwnd, hRgn);
                Region region = Region.FromHrgn(hRgn);//err here once
                if (!region.IsEmpty(gfxBmp))
                {
                    gfxBmp.ExcludeClip(region);
                    gfxBmp.Clear(Color.Transparent);
                }
                gfxBmp.Dispose();
                return bmp;
            }





     Timer timer3 = new System.Windows.Forms.Timer();
                timer3.Interval = 1; // 1초
                timer3.Tick += new EventHandler(timer_Tick2);
                timer3.Start();

