ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Error: Capture Screenshot not working after Publish in IIS<p>Hi <a class="username" rel="sonnytle">sonnytle</a>,</p> <p><font size="2"><font face="Arial">Does you have added reference to the given libraries in the iis.<br /></font></font></p>https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/Thu, 16 Mar 2017 09:15:54 GMTError: Capture Screenshot not working after Publish in IIS<p>Hi dharmendr,</p> <p>Thank you for the quick response.</p> <p>Yes, i have added the two references to the website on IIS server:</p> <p>1.&nbsp; System.Windows.Forms</p> <p>2.&nbsp; System.Windows.Forms.DataVisualization.Design</p> <p>&nbsp;</p> <p>It works on my local PC, but not on the IIS Server.</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/Thu, 16 Mar 2017 09:28:17 GMTError: Capture Screenshot not working after Publish in IIS<p>Hi <a class="username" rel="sonnytle">sonnytle</a>,</p> <p>As you can see the Demo is working. It might be some script file missing or incorrect path or javascript error. Please verify these.</p>https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/Thu, 16 Mar 2017 09:55:58 GMTError: Capture Screenshot not working after Publish in IIS<p>Hi dharmendr,</p> <p>Do you think it might be because the System.Windows.Forms dll is a client side component so when used on the server side, it does not work?</p>https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/Thu, 16 Mar 2017 10:02:42 GMTError: Capture Screenshot not working after Publish in IIS<p>I have narrowed down to the while loop (shown in red font) that does does not complete. &nbsp;The loops does not exit:</p> <p>protected void Capture(object sender, EventArgs e)<br /> {<br /> string url = txtUrl.Text.Trim();<br /> Thread thread = new Thread(delegate()<br /> {<br /> using (WebBrowser browser = new WebBrowser())<br /> {<br /> browser.ScrollBarsEnabled = false;<br /> browser.AllowNavigation = true;<br /> browser.Navigate(url);<br /> browser.Width = 1024;<br /> browser.Height = 768;<br /> browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(DocumentCompleted);<br /> <span style="color: #ff0000;">while (browser.ReadyState != WebBrowserReadyState.Complete)</span><br /><span style="color: #ff0000;"> {</span><br /><span style="color: #ff0000;"> System.Windows.Forms.Application.DoEvents();</span><br /><span style="color: #ff0000;"> }</span><br /> }<br /> });<br /> thread.SetApartmentState(ApartmentState.STA);<br /> thread.Start();<br /> thread.Join();<br /> }</p> <p>private void DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)<br /> {<br /> WebBrowser browser = sender as WebBrowser;<br /> using (Bitmap bitmap = new Bitmap(browser.Width, browser.Height))<br /> {<br /> browser.DrawToBitmap(bitmap, new Rectangle(0, 0, browser.Width, browser.Height));<br /> using (MemoryStream stream = new MemoryStream())<br /> {<br /> bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);<br /> byte[] bytes = stream.ToArray();<br /> imgScreenShot.Visible = true;<br /> imgScreenShot.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(bytes);<br /> }<br /> }<br /> }</p>https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/Thu, 16 Mar 2017 10:52:26 GMTError: Capture Screenshot not working after Publish in IIS<p>If you are getting any error please provide or check the browser console window for the error details.</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/Fri, 17 Mar 2017 03:09:18 GMTError: Capture Screenshot not working after Publish in IIS<p>Thanks dharmendr. &nbsp;I finally found the issue to be browsing permission set on the web server. &nbsp;If i set the URL to a local website then it works.</p> <p>I really appreciate your assistance. &nbsp;This is a great forum!</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/https://www.aspforums.net:443/Threads/354886/Error-Capture-Screenshot-not-working-after-Publish-in-IIS/Fri, 17 Mar 2017 04:29:45 GMT