WPF Windows 7 VERY Slow to start - wpf

I am a solo developer at a small company. Recently, we undertook a complete re-write of all of our U.I.'s for configuring our windows service which is our core product. I'd been developing primarily for windows 8,8.1, and 10. We had seen no issues and the U.I. looks great. When deploying any of the applications to a windows 7 X64 with identical hardware as the other boxes we've used to test, we are seeing a near 30 second startup time when opening any application written in WPF dot net 4.5, regardless of complexity or lack there of (literally the same problem exists when showing a WPF form with nothing on it, just a blank form). This is extremely disheartening, as this makes them un-usable because one of these apps is a custom credential provider U.I. which is unreasonable to ask a user to wait that duration for the U.I. to be shown so they can log in.The other configuration utilities have this slow load time when running in user space so i do not believe it has to do with being launched from the credential provider COM object we've written. Can anyone shed some light on this issue please? I really don't want to go back to win forms because we really like the new look and feel that WPF provides. Is there some patch, update, or trick we can use to get a machine with plenty of horsepower to behave like its 8&10 counterparts?
All machines are identical i7 3.47 Ghz dual core with 8 gig of ram; which should be PLENTY sufficient.
UPDATE: Installing .net 4.7.2 has drastically sped up the launching from about 30 seconds to about 6 seconds. Still not acceptable, but on the right track i guess.
Thanks in advance.

I have put my windows 7 box onto the the internet, installed ALL updates, and installed .net 4.7.2 and it seems to have fixed the issue. Thanks for the suggestions.

Related

Is Oracle ADF always this hard to deploy?

I've been working with Oracle PL/SQL and forms ¿for the last 20 years.
Like 8 years ago oracle people started to say their route map was that every new development should be done in Java with ADF and not in forms.
5 years ago we had to start a new project so we did it using that technology, because we had the feeling that sooner or later Oracle was going to stop suporting and publishing new versions of forms and reports.
The project was successful, but mantinance, deployment and configuring the developer's PC's is a lot hard and painful.
Starting with the fact that we have to deploy all the application every time we do an small change in any page, comparing with the fact that in forms we just have to deploy the altered form's FMX
And that is not the most unconfortable part, some times we deploy the applications EAR and we do not know why some classes are missing, so we have to compile everything again and deploy again.
In the last month we had to change our old Win 7 PC's for new ones, but I do not know why when I run the ant XML that should generate the EAR it does not find oracle.jbo.server package
Is this developing environmet always so hard and buggy ???
Although I understand this thread below is a bit old... but still a good source to refer it.
What is Oracle ADF?

Selenium script breaks when doing other activities

I am using selenium to automate my application.. My applicaton works on IE only.. I dont have much scope for other browser..
but when my scripts are running if i do other activities like reading mails, or update QC in another window.. Those are breaking my scripts (no such element or no such window..) once in a while (mostly out of 10, 2 to 3 times i am facing this issue). But can not make system idle till my scripts are run as i do have other activities after started the script. How to stabilize this?? Any one facing these kind of issues??
Running Selenium tests locally using your one and only IE browser does come at the cost of having to not touch your mouse or keyboard during test executions. A way to get around this is to create one or more virtual machines. VirtualBox from Oracle is a popular choice but there are others. You need to install an operating system on your new virtual machine and odds are that your existing Windows license is single use. You can request an additional Microsoft Windows OS license from your IT department or simply buy one yourself for, what? $190? I have done that when the paper work at my client was unmanageable. My time is worth more than that.
Another alternative is to take advantage of 90 day free licenses from Microsoft.
Start your test on the virtual machine then change focus back to your desktop to do other work. I have even added code to the end of test logic to beep when the test completes so that I know when to expand my virtual machine.
Update
You should add an antivirus to that virtual machine. Safety first. :-)
Selenium does not support and non web-based applications, it only supports web based applications.
So if you are doing activities like reading mails and update QC in other window, you will not able to find the elements through selenium.
If you are facing some challenges with IE browser. Please refer this link:https://code.google.com/p/selenium/wiki/InternetExplorerDriver
There are following limitations are given below:
Some limitations of Selenium Automation tool are as follows:
It does not support and non web-based applications, it only supports web based applications.
Its and open source tool so in case of any technical issues you need to rely on the selenium community forums to get your issue resolved.
You need to know at least one of the supported language very well in order to automate your application successfully.
No inbuilt reporting capability so you need plugins like JUnit and TestNG for test reports.
Lot of challenges with IE browser.

WPF application slow on startup

My WPF application currently only shows a screen with some controls, it doesn't connect to DB or has any other functionality. It's a simple UI screen.
When I was testing in some computers (WinXP SP2), I've detected that it took more than 15 seconds to startup. They were all in our domain.
I've grabbed a similar computer, only with Windows installed, and the application took 2 seconds to startup.
Then I added the computer to our domain, and testing it with a domain user showed that it also took 15 seconds to startup. I tested again with the previous user (local user) and it's still fast. I created another local user, but it takes the 15 seconds that the domain user also takes.
I've added other local users but they were also slow.
To summarize: the application starts fast (2 sec) in only one user, the first one I tested. All other users (domain or local) are slow (15 sec).
I've been checking Improving WPF applications startup time but my problem seems to need a different approach. Does anyone figure out what can be happening?
I found another solution to this problem in this documentation from Microsoft.
Adding the following configuration to the app.config file will also solve the problem:
<configuration>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
</configuration>
This way, you don't need to change computer configurations. It's just configuration of the application.
UPDATE:
Seems that .NET 4.0 fixed this issue, as documented here on MSDN.
Is the system connected to a network, but cannot reach the internet because the proxy is not configured? If so, go to Internet Settings (i.e. Internet Explorer Properties), Advanced, and look in the tree view for Security and a checkbox like "check revoked certificates" or something (I'm using German Windows, so I don't have the English label at hands). Uncheck and test again.
If this fixed the problem, you have one signed assembly that is not from Microsoft for which the .NET Framework will check for revocations, and time out after 15 seconds. If you disable the checking or configure the internet connection properly, you won't have to wait.
Does it open up a file or interact in the network in some way? Because if not, I would suggest that whether or not you're logged into a domain or running as a local user is probably a red herring.
Are you building in debug or release mode? It's worth trying release mode if you've not already because running in debug does a load of extra error checking..
Have you checked if there are any domain policies that can affect this scenario?
I had still this Problem (.NET 4.5). I my case the problem was, that the computer was not connected to the internet, but there were some other device (cameras etc.) which were connected via GigE. The startup of every .NET Application was delayed for about 20 seconds.
The solution was quite easy: Just connected the computer once to the internet, started any .NET application (first startup took about 7 seconds) and after that, every startup was quite fast, even if the computer was no longer connected to the internet. In addition I had to disable the protocol TCP/IP V6 (caused 3-5 seconds delay).
Another possible solution is to select Properties for the "internet Protocol Version 4 (TCP/IPv4), then select Advanced, select the tab "WINS" and set "Disable NetBIOS over TCP/IP".

Silverlight 3 can run out of the browser.. what extra functionality this offers for developer.. and for the user?

Silverlight 3 can run out of the browser.. what extra functionality this offers for the developer.. and for the user?
it allows the disconnected (no need of internet connection) use of sl application + start menu shortcut + some other things you can read about here.
It allows the user to have a desktop experience without longlasting installations and with quick and easy removing of applications. The barrier to download, install and try an application is much lower, which is good for both, the developer and the user. The developer has greater chances to distribute it's application and the user won't miss a great app because it has a 500MB setup.exe and an one hour installing process.
It also allows for more isolated storage (25MB vs 1MB on the web). This will be nice for a lot of applications that were previously starved for space.
More access to the keyboard (e.g. the function keys) when in out-of-browser mode since the browser is not intercepting them.

Auto update for WinForms application

When creating an auto updating feature for a .NET WinForms application, how does it update the DLLs and not affect the currently running application?
Since the application is running during the update process, won't there be a lock on the DLLs (because those DLLs will have to be overwritten during the update).
Usually you would download the new files into a separate area. Then shutdown and restart and at startup you look for and use the new files if found. Always keeping a last known working version on the side so that the user can revert to something that definitely works if the download causes problems.
ClickOnce is a good technology from Microsoft that does this for you and you can use it directly from Visual Studio 2008.
You'll have to shutdown your application and restart it, as other people have already commented.
I wrote an open-source code to do just that in a transparent mode - including an external update application to do the actual cold update. See http://www.code972.com/blog/2010/08/nappupdate-application-auto-update-framework-for-dotnet/
The code is at http://github.com/synhershko/NAppUpdate (Licensed under the Apache 2.0 license)
I have a seperate 'launcher' application that checks for updates via a web service. If there are updates, it downloads them and then executes my application, which is in a seperate assembly.
The other alternatives are using things like ClickOnce, or downloading the files to a seperate area and restarting the app, as someone else mentioned.
Be warned about ClickOnce, though - it's not as flexible as it sounds. And if you deploy to a system that requires elevating your program to a higer security level to run, you might run into problems if you don't have a certificate for your app installed. I found it very difficult to get straight answers on the Internet to things like certificate management when it comes to ClickOnce. If you have a complex app, you may want to just roll your own updater, which is what I ended up having to do.
If you publish via ClickOnce, all of that tends to be handled for you. It has it's own pro's and con's but usually easier than trying to code it all yourself.
Both Wikipedia and 15seconds have decent info on using ClickOnce, how it works, etc.
As others have stated, ClickOnce isn't as flexible as rolling your own solution but it is a LOT less complicated. It has a small learning curve at first, but with pretty much everything bundled into Visual Studio and the use of Wizards, it usually doesn't take long to stumble onto a working solution.
As deployments get more complex (i.e. beyond than just having prerequisites or application code that needs updating) and you need to do a lot of post-install or pre-install tasks, there are things like WiX which give you somewhat of a hybrid solution between Windows Installer and ClickOnce, with the cost of flexibility being a much steeper learning curve.
The only reason I try to avoid custom installers is that you end up spending way too much time trying to get it just right to handle a bunch of different "What If" scenarios...
These days Windows can do such updates automatically for you with AppInstaller if your app is packaged in the MSIX package.
It downloads the new version of the app in another folder inside ProgramFiles\WindowsApps, then when a user runs the app via the start menu, the system knows what folder it should use. The previous version gets deleted when not in use.
If you want to know how to package your app this way I collected my findings in this answer.

Resources