ActiveX cannot screen capture a page that is hosted on the same server - activex

I have an app that takes a screenshot of web pages and creates a resized image. The app is basically loading a web page that calls an ActiveX to load a web page using IE resources and take the screenshot. This app has been running on a Windows Server 2003 without any problems for a couple of years.
But now that I have upgraded the server to Windows Server 2008, the screenshot action is timing out. From tests I can see that it successfully takes a screenshot of any web page hosted on the Internet... except pages hosted on the same server.
Whenever it tries to capture a page loaded on a site hosted on the same server as the app, it times out. ESC is disabled and it seems that all other permissions are ok, ie: it works for remote pages but for home pages.
Any ideas as to what can be causing this and how to fix it?
After further testing I have narrowed down the reason for failure being due to the page being popluated from a MS-SQL database record on the same server as the one taking the screenshot. The same page generated on a remote server captures ok. I have further established that the error is not peculiar to the ACASystems DLL because it also affects another DLL for creating MHT files from web pages. This DLL (Chilkat.MHT) also uses IE to load and assemble the web page on the fly and then saves it as a.mht file.
So the problem is more related to IE assembling web pages from MS-SQL while running ActiveX. But to resolve this enigma?

Maybe a routing issue (DNS/hostfile..) ? Does the page loads on local session with IE ?

There is no solution for this without editing the ActiveX code. Since the DLLs in question are third party resources, such editing is not possible.
After testing 3 different ActiveX that load a web page that either take a screenshot or save as .mht, it was found that they all failed when loading a page that was querying SQL on the same server. After contacting the 3 DLL developers we were informed by all of them that their ActiveX has no impact on MS-SQL.
Unfortunately, our tests tell us otherwise. At this stage we are left guessing however this article about in-process vs out-process execution may be related.
The workaround for us to solve this problem was to assemble the page to be captured from request queries passed to the page rather than populate from SQL queries. This alternate works perfectly.

Related

Umbraco 7 Content editor randomly hangs when generating thumbnails

Umbraco 7.6.6, running under IIS 8.5 on fully patched Windows Server 2011 R2 Standard, 64bit.
Our content editors notice that often when they create a new article (which has some graphics specified) the system hangs after they try to browse to a different article... or indeed anywhere in the front-end site, too. It only affects them; other users are still able to browse and/or create content.
F12 dev tools shows that browser is pending the result of this type of call:
http://whatever.com/media/1101/thumbnail_pmc-1x2.jpg?width=500&mode=max&animationprocessmode=first
If I try to view that thumbnail without the querystring data, it loads instantly... while the first call is still hanging in it's unresponsive tab:
http://whatever.com/media/1101/thumbnail_pmc-1x2.jpg
DEBUG level Umbraco logs just show this:
2017-10-10 17:02:53,120 [P2816/D6/T57] DEBUG Umbraco.Web.UmbracoModule - Begin request: http://whatever.com/media/1101/thumbnail_pmc-1x2.jpg?width=500&mode=max&animationprocessmode=first.
No errors in the umbraco logs, no errors in IIS logs, nothing in event viewer.
Best I can tell, something is going wonky in the browser. Can anybody please advise on how I can troubleshoot further?
Thanks!

Ensuring an acceptable online user experience while republishing to a live site

It's pretty much known that publishing to a remote location using VS2008 is a an exercise of great patience and faith.
As long as a 'publish' begins (using VS2008, publishing an MVC site), that site might be down from the first file that is successfully transferred. The problem being that unreliable internet access, or interesting error messages () can break the site, and require restarting.
It's understood that there is little to do from the VS2008 end. The question then:
What strategy can I use to ensure that there is an acceptable user experience during the 'downtime'? (e.g. "This site is currently under maintenance...")
A lovely feature of ASP.NET/IIS is that if you place a file named app_offline.htm in the root of the web application, all requests will redirect to that file. This would include requests for images, stylesheets, scripts, etc.. so you'll need to condense all media for the page into the page itself.
In fact, while Visual Studio is in the process of publishing your web application, it will place this file in the root of the application and remove it when the publish is complete. While Visual Studio doesn't allow you to customize the contents of its app_offline.htm, you can take the application offline yourself simply by uploading that page.

Site not completely loaded in the browser

I have a MVC 3 project hosted on IIS 5.1.
80% of the time everything is working fine, but often when the connection is slow, the page is not loaded completely in the user's browser. The loading finishes fast, but certain CSS definitions and images are not loaded and not displayed in the browser.
I tried it with Firefox and IE and the results are the same.
Is it IIS 5.1 that causes this problem?
Did you try to find out why the css and images are not loaded? E.g. with Firebug or Fiddler? It would be helpful to see what status code you get back.
Could it be that the site is accessed by my multiple users at the same time? Since you are using IIS 5.1 I assume you are using Windows XP Professional. As far as I can remember Windows XP Professional has a limit of 10 simultaneous inbound connections. So if you access it with multiple users at the same time you might be hitting that limit as most browsers open 4 to 6 connections per domain/website.
Edit by xsl: Here is how you up the connection limit on IIS5 to the hard-coded maximum of 50: http://weblogs.asp.net/cazzu/archive/2003/10/10/31476.aspx

Crystal Reports CrystalImageHandler and MVC .NET

I am unable to show images in CR reports. I'm developing a MVC 2 project in VS 2008 with Crystal Reports that comes with it (10.5). Everything works fine, except for images. I can see them in the preview mode within the CR designer, but not when the app is deployed, which means I am loading data OK but something's wrong with IIS and/or routing.
When running the app, images appear with the red cross and if I navigate to the following url directly I get a 404 error.
http://localhost:1234/CrystalImageHandler.aspx
I think my problem is similar to the one here but that workaround doesn't seem to work for me.
I should also comment that I'm using the Areas feature within MVC.
EDIT: Forgot to add: When exporting the report to PDF the images are shown ok.
I don't know much about crystal reports, but is there an Http Handler? If there is and you are running IIS 7 on the live server, is the handler registered in the web.config under both system.web/httpHandlers and under system.webServer/handlers?
I forget to register the handlers under system.webServer/handlers for our IIS 7 server sometimes and we were having a similar issue with the Microsoft Charting Controls.

Using WatiN through MbUnit to test ASP .Net MVC web application

I am trying to apply some WatiN UI tests to my new ASP .Net MVC application, running the WatiN tests through MbUnit, but am having some difficulties.
If I follow the instructions (exactly) on this page, then the google homepage loads, up the text is inserted, the search is done and the test passes. (no problem here).
However, when I simply change the URL of the line...
var ie = new IE(new Uri("http://www.google.co.uk"));
to the website hosted on my PC through IIS (on Win7), (e.g. to http://localhost/myapp/) the homepage of my application loads fine, but the test-runner seems to still be waiting for confirmation that the page has loaded and then the test fails due to a timeout.
Here's the failed response from within the IDE...
*** Failures ***
Exception
WatiN.Core.Exceptions.TimeoutException: Timeout while Internet Explorer state not complete
at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.ThrowTimeOutException(Exception lastException, String message)
at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.HandleTimeOut()
at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.Try[T](DoFunc`1 func)
at WatiN.Core.WaitForCompleteBase.WaitUntil(DoFunc`1 waitWhile, BuildTimeOutExceptionMessage exceptionMessage)
at WatiN.Core.Native.InternetExplorer.WaitForComplete.WaitWhileIEReadyStateNotComplete(IWebBrowser2 ie)
at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.DoWait()
at WatiN.Core.DomContainer.WaitForComplete(IWait waitForComplete)
at WatiN.Core.IE.WaitForComplete(Int32 waitForCompleteTimeOut)
at WatiN.Core.DomContainer.WaitForComplete()
at WatiN.Core.Browser.GoTo(Uri url)
at WatiN.Core.IE.FinishInitialization(Uri uri)
at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, Boolean createInNewProcess)
at WatiN.Core.IE..ctor(Uri uri)
at FppRendersUI.Test.Program.DoSomething() in C:\Dev\MyCode.Test\Program.cs:line 18
Anybody else get this, or is it just me?
There should be no significant differences testing a website on locahost.
Two possible causes:
If your webpage contains any significant AJAX then it's possible that the page never appears to be fully loaded so WatiN just keeps waiting.
I have fixed one or two bugs in WatiN now and then related to detecting that a page has been fully loaded. You might try grabbing the WatiN trunk source and building a fresh copy of the latest code.
If none of that helps, WatiN also has "NoWait" variants of several actions like clicking. You can also override what it means to WatiN to wait for a page to be complete by registering a WaitForComplete handler.
I've had this happen to me when I had a reference to a resource that didn't load.
Do have a reference to a JS, CSS, or image file that doesn't exist?
If you look at the HTTP traffic with Fiddler do you see any connections timing out?
Make sure the program is running as an administrator. On Win7 it will load the page but Watin can't access the DOM unless Visual Studio or Gallio Icarus are started with administrator privileges.

Resources