Virtualy Test WPF Compatibility - wpf

I am running Windows 8.1 on a Intel core i7/8GB hardware configuration.
I had developed one WPF application which is running absolutely fine on my machine, but my some of clients have different low end configured devices like Intel ATOM dual core/2 GB on which the application is lagging.
My question is how do I create a virtual environment like my client's and test the application on it.
Does anyone know how to achieve this without or with a VM? Are there any features in Visual Studio to support this type of testing?

Using VM is OK. there are no any tools in VS to solve it.
Just create VM with 1 GB of RAM and 1 CPU

Related

Random task deadlocks/memory corruption in wpf application in virtual machine running .net 4.8

So I have spent the better part of two days troubleshooting a very weird issue. At no point running my application on the development workstation or a physical workstation did I ever encounter any issues running the application.
The app has reached a point in the development lifecycle were it was time to start doing more targeted regression testing. This included running the application within virtual machines as I wanted to support the application running in virtualized environments.
Well upon testing in virtualized environments I noticed a very weird issue randomly any command I had binded that opened a child window would sometimes not work. The child window will not render and the button would be greyed out due to the canexcute of the command giving false since it thought the command was still running. This issue cannot be reproduced on a physical machine and have tried greatly.
After research I saw a lot about virtual machines and wpf rendering and people stating to force software rendering instead of allowing hardware rendering. This did not work either.
Further research/testing found this didn't have to be a task that rendered a simple child window and it could be any task that would lead to this random issue.
After beating my head I have found these articles
https://www.gresearch.co.uk/2019/12/20/deep-dives-in-debugging-when-it-really-isnt-your-fault/
https://github.com/dotnet/coreclr/issues/26990
https://github.com/dotnet/coreclr/pull/10065
Long story short is that this is an issue with .net 4.8 and if I run in a virtual machine running 4.7.2 these issues are not reproducible. I am going to leave this open though as I did notice something odd after discovering this information and testing further.
I have discovered that if I run application on a virtual machine with .net 4.7.2 with TWO or more vCPUs that these random issues are not reproducible. But if I run on a virtual machine with .net 4.7.2 and ONE vCPU the issue still arises. Furthermore if I run application on .net 4.8 with TWO or more vCPUs the issue arises. Lastly if I run on .net 4.8 with ONE vCPU the issue is not reproducible.

Windows 10 with 4GB RAM (HDD) optimization setup for MERN stack development

I'm developing with MONGODB service & Express server running and React app compiling on my Windows 10 with 4GB RAM (HDD).
These are my optimization setups to improve my hardware performance, I guess some of them are now automatically revised by Windows itself.
My virtualization is enabled.
Most tips on https://youtu.be/nVy4GAtkh7Q including to Disable Privacy Settings, High Performance Power Settings and to Disable Indexing, excluding to Disable Firewall and the execution of any program.
I have used: https://github.com/10se1ucgo/DisableWinTracking
I'm now using Opera since it's more lighter than Chrome.
I'm disabling Windows Defender while my local servers are running.
Setups that I'm not preferred to use:
Not preferred to use Chrome 'cause my React app's tab is sometimes freezing.
Not to debloat Windows with https://github.com/W4RH4WK/Debloat-Windows-10 since it have a possibility to mess up something.
Not to permanently deactivate Windows Defender.
Not to disable Opera hardware acceleration 'cause the 3D graphics without acceleration is like in slow mo.
Current issues:
Opera is sometimes crashing (still better than freezing).
VS Code still experiencing lag.
Is there anything that I can do to improve the performance of my 4GB (HDD) hardware (while I'm in short to buy a powerful hardware)? Is there a recommended setup for MERN stack development?

How to run windows IOT core Console Visual C++ Application in Windows 10 IOT device.?

I am able to execute it via power shell . But not able to directly run from IOT Device raspberry pi.
If there is not available option for execute Console Application from IOT device which is best alternative application platform for this?
IS there any tools availables that convert Console application to Application that can be run on IOT device ?
If you want to directly run the console application when you are in develop,
You can refer to this link to get the steps of running and debugging C++ console application on Windows IoT Core device.
If you use visual Studio to develop your application, you can install Windows IoT Core Project Templates for VS 2017 and then build a background application. Background Applications are applications that have no direct UI(Headless). Once deployed and configured, these applications launch at machine startup and run continuously without any process lifetime management resource use limitations. Hope that can help you.
it's easiest to view console output from a visual c++ app if you launch the app from an ssh session. try using putty to connect to your raspberry pi, and then run your commands in the ssh session. Instructions here To determine whether your visual c++ app is compatible with Windows IoT, you should run the iot core porting tool which is available here

How to Check the App is running on Tablet or PC using C# code

I want to check the app is running on Tablet or PC using C# code in Windows 8 Metro Style apps
The short answer is: It can't be done.
You can have a tablet that doesn't run with a ARM processor, then it's basically a laptop, just in another form factor. The form factor is not something you check for using code. However you can still find the architecture and determine if you run ARM/x86/x64 checking out this blogpost - and then writing:
var cpu = await SystemInfoEstimate.GetProcessorArchitectureAsync();
You can also, in your project, set the CPU configuration - create separate ARM/x86/x64 configurations. And thereby create conditional builds of your application fitting each architecture.

Differences between ScheduledTaskAgent for Windows Phone 8 and 7.1

I have a big problem.
I wrote an app for Windows Phone 7.1+, and it's also published on Windows Phone Store:
this app works well for Windows Phone 7.1 and also for Windows Phone 8, and there were no problems during app submission process (who also declares that my app is fully compatible with any OS since Windows Phone 7.5).
The problem is related only to my Scheduled Agent, which runs perfectly on Windows Phone Mango (7.1), but it is not firing at all on Windows Phone 8 (I've also tested my app on real devices, with both the OS').
When I upgraded to Visual Studio 2012 (Express for Windows Phone), I've noticed that it is possibile to add two different types of ScheduledTaskAgent project: one for Windows Phone 7.5 and one for Windows Phone 8 (obviously it wasn't so in Visual Studio 2010...and I used the only one available = the first) !
Dou you think this can be the reason while the scheduled agent is not working in WP8?
What's the difference between the two projects types?
How to manage (in code I mean) two projects of that type? Is it possible?
How can I choose which task I have to register (see code below)?
Will the submission process fail with two ScheduledTaskAgent projects (I think so)?
This is the critical part of the code, when I'm registering my task at startup:
PeriodicTask newTask = new PeriodicTask("MyTaskID");
newTask.Description = "my Description";
ScheduledActionService.Add(newTask);
#if DEBUG
Microsoft.Phone.Scheduler.ScheduledActionService.LaunchForTest("MyTaskID", TimeSpan.FromSeconds(5));
#endif
Thank you in advance.
The only difference between the two project types is (1) the Windows Phone 8 one targets Windows Phone 8 instead of 7.1 and (2) it references the Windows Phone 8 SDK instead of the Windows Phone 7 dlls.
I have an application where I have two projects (7.1 and 8.0). I also have two background agent projects (7.1 and 8.0) and I share code between them using linked files. I reference the 8.0 agent from the 8.0 project and the 7.1 agent from the 7.1 project. I used this example as a best practice for having the two versions of code.
You do not want to reference two agents since that will not work.
If you remove the #if DEBUG does your agent get called when you're debugging?
First make sure you got the proper reference in app manifest file.
<ExtendedTask Name="BackgroundTask">
<BackgroundServiceAgent Specifier="ScheduledTaskAgent" Name="MyApp.Agent" Source="MyApp.Agent" Type="MyApp.Agent.ScheduledAgent" />
</ExtendedTask>
Second the Agent library must be referenced in the main app project.
Third, make sure you are not exceeding the allowed running time or memory allocation. In WP8 the cap for background agent was raised to 11MB. Also there is a limit of app with registered background tasks, so it might be possible that there was no free slot for your task with bg agent.

Resources