RenderTargetBitmap renders empty images - wpf

Here's the situation: I have an ASP.NET Web Forms application which uses WPF controls for reporting.
Process is the following: Create WPF controls and bind to data -> create image from WPF control -> use generated image to create PDF reports.
I'm using RenderTargetBitmap to render bitmaps from WPF controls. Issue is when I run all this on my local machine (Windows 10) it works, as soon as application is deployed on QA machine (Windows Server 2008 R2) it generates empty images.
I tried to simplify reporting page, by leaving only static text on the WPF control, still I get empty page.
I created sample console application which mimics part of binding data to WPF (granted static data) and generating image from WPF control & it works on both environments. One difference I can think of is the console application is not running as IIS' AppPoolIdentity, which runs the Web Application on the QA machine.
I came across this SO post which suggests there was a Windows Update that caused similar issue. Our QA machine is Azure VM, so updates are installed regularly. Update that caused the issue is from September 2017, having fix update out in October 2017. So I rulled out windows update causing the issue.
Also in the referenced SO post, OP suggests that this issue happens only if account running the code is System account
It ONLY doesn't work if run under high privilege SYSTEM account (e.g. from Task scheduler).
I tried this as well, having Task Scheduler running the sample console app, but as I mentioned above it successfully created the image.
So at this moment I'm pretty much out of ideas.
The application code that is supposed to generate images is scattered so I'm not sharing it here, but if any piece is of particular interest happy to post.
Any idea what can cause this different behavior in diff. environments ?

It turns out ruling out missing Windows Update was not the right thing to do.
At the end I installed the fix windows update and issue was solved.

Related

All converted apps including samples fail to run with a 'The parameter is incorrect'

I'm trying to convert a WPF oneclick installed application and so everything should be pretty straight forward. However, whenever I run the debug project, I get
'The parameter is incorrect'
in a message box popup and I can never run the app.
This happens for my app while trying to debug, all the samples from github, and even the DAC application from the Windows Store. The error pops up even once the app is installed and showing in my application list.
I'm on the latest build of the Creators Update.
There are various errors in the event viewers, but they seem to be a common occurence for WinRT apps.
Any ideas at all?
If you have the WPF project in VS2017, I'd recommend to package directly from VS without using the DAC. see the article for more information https://learn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-packaging-dot-net
The problem appears to be related to the May Security Update. I restored Windows to the factory defaults and everything works fine.
However, once I install the the May Security Update to address this bug with Sql Server and Filestreams, the Desktop Bridge Debugging project stops working.
I'm going to throw out a random guess that it's related to the Microsoft Malicious Software Removal Tool, as the event viewer logs mentioned an issue with the 'parameter is incorrect' referring to the Microsoft.MRT.
Of course it could be anything, and as only 7500 people have even downloaded the Desktop Bridge Debugging project in the first place, I doubt it's high on the list of Microsoft Developer Priorities.
And to be completely honest, it's really probably my fault for not rewriting the app as a UWP app, after rewriting it as a Windows Forms app, and as a Silverlight app, and as a WPF app and on and on and on. Although, I'm not sure how many glasses of Kool Aid are left in the punch bowl for me.

Cocs2d-x + XAML on windows phone 8

A couple of weeks ago the new cocos2d-x (version 2.2.1) was released with great support for windows phone. However, there is one thing missing in the templates and examples: integration of XAML with Cocos2d-x. A feature that is absolutely necessary for free to play games that use ads since every single ad network uses a silverlight component.
I tried to implement the integration myself but I am stuck and all I get is a black screen. I used the following strategy for implementing it:
modified the CCEGLView class. The create method takes the follwing arguments:
bool CCEGLView::Create(In IDrawingSurfaceRuntimeHostNative* host, In ID3D11Device1* device)
in the XamlComponent class of the visual studio template I have added CCApplication member variable and the Connect methos create the CCEGLView and runs theCCAplication.
Everything compiles without any errors and runs without any crashes. However, the screen remains black :-( My guess is that the drawing surface / windows is not correctly passed but I do not know how I can do this.
Any help and ideas appreciated.
Cheers
Tom
Cocos2dx 2.2.1 used native mode, currently it's not support XAML+native hybrid mode.
CoreWindow is a fundamental component, do you remove all the referene to CoreWindow?
You can look up from this project, they've a branch for wp8+waml.
https://github.com/MSOpenTech/cocos2d-x/tree/wp8-xaml

Windows presentation foundation host crashes

we are using a saas application that uses WPF. it usually work fine on every browser we use
but one of our user recently was transferred to a different office and from that day he gets an error on IE 8 about WPF encountered a problem and the application crashes. same for the other browsers.
could it be connected to the network he wired to?
I am Exactly getting the same error.
A some of the forums suggest registry access problem but when I run the tool it says no problem with access.
I guess my website response is XML which is some how not been interpreted by IE.

WPF application issues on windows server 2003/2008

I deployed my WPF application on windows server 2008 and its working fine when i started using of it. But after some time i'm facing so many problems with my app like its freezing some windows/controls and some windows only minimize, maximize and close buttons are working and in some windows some controls only working, any one help me please to get out of this.
Thanks,
#nagaraju.
In a server environment, you should deactivate Hardware rendering, as most servers have only very limited GPU performance. See this link, item 6, on how to set this. Please report after ensuring software rendering is enabled.

Why does Inspect.exe not display the AutomationId and other UIAutomation properties when running in debug?

I've been using Inspect.exe from the Windows SDK to examine the properties of a WinForms application but noticed that I didn't see any of the properties (for example, the AutomationId) whilst running the application from Visual Studio (F5 to run.) However, if I ran the .exe from the bin\debug folder I could see the properties fine.
The source I was using was example code downloaded from UI Automation Custom Provider Samples - Part 3.
I'm wondering why this happened since I'm sure another machine that I had tried this on worked fine and I wasted time poking around in debug mode wondering why my UI Automation properties weren't visible. Obviously there's a workaround but I'd like to understand why this was happening and have a record of the problem for other people to find!
I've struck upon the answer - because I had launched Visual Studio as Administrator but the Inspect.exe tool as standard user then the properties being reported back were a sub-set of what I should have seen. As soon as I launched Inspect.exe as Administrator it worked!

Resources