c# Wpf application different behavior - c#

I hope someone can help me, as I can not find the solution myself. (I know Google is my friend..etc)
So, I have a relatively simple c# application (it reads a specific XML node from three different XML files and then adds these nodes innerText to a combobox. - for find and replace)
The application runs fine on my own work and home computer both in VS debug mode and as .exe.
But when I sent the .exe file to my colleagues (from 3 people, 2 failed) they have experienced that the program started but the combobox was empty.
(all computers are running Win 10, no restrictions on the office computers, all windows updates are installed)
So I'm out of ideas...

Apart from the excellent suggestion of adding logging (loads of it, at every relevant line of code for debugging purposes), if you're using WPF, you can also use Snoop, which will allow you to dig into the binding, which can be very helpful.

Related

Is there an alternative for the SendKeys class that will work with Windows 10

I cannot find any definitive information anywhere but the System.Windows.Forms.SendKeys class appears to have been blocked / disabled / depreciated in Windows 10.
I wrote a demo program that monitors the users keystrokes and if a user enters a known code it will pop up a form and then go off to a document database and return various strings (company names / addresses / contact lists etc) and replace the typed code with the retrieved string. SendWait is used to send the retrieved strings to whatever program typed the code.
I built the program on the companies Windows 7 desktops but when I ran it on my personal Windows 10 system it didn't work. A lot of reading later and I feel like a complete idiot but I cant let them take this project any further knowing that they wont be on Win7 forever.
So my question is has this sort of functionality definitely been disabled in Windows 10 or is there another way or method I would be able to use to achieve this behavior of inserting text into running programs.
Any help appreciated.
I found this Forum-Thread:
https://www.tenforums.com/software-apps/49635-sendkeys-not-working-windows-10-a.html
SendKeys is Blocked in W10. In W8.1 it still works.
There are other anoying things, like not allowing App to Read or Wright to Drive C. The "file" is there but W10 "hides" it or simply not allowing to access it.
There are Netwok problems also, not allowing App to work on LAN environement.
Well, my opinion is that W10 behaves like Malware to user PC. Useless.
They had no solution.
It looks as if Sendkeys works with some apps and not others. I can automate an older app by sending it keystrokes but newer apps like Chrome don't respond. The inconsistent behavior has seriously messed up scripts that worked fine under Win 7.
I have not found any official documentation that says that Sendkeys has been deprecated so the inconsistency looks to be a Windows 10 bug.

Visual Studio 2017 C#: How to create an Installer that can provide continuous updates

I've been trying to find an answer to this for weeks. Hopefully you are able to help me out! :)
I've got a C# application. It has multiple classes and multiple Forms. The forms also have images on them in PictureBoxes.
These images are all stored in an Assets folder inside the bin folder i.e. /bin/Assets.
When developing, I run the application in Debug mode.
I have looked on YouTube and all areas of the internet to find how to create an installer for my application. I see a majority of posts about ClickOnce deployment, which looks like it's what I want. The issue is that the ClickOnce wizard asks you where to install the application:
I do not have a server to host the application on (I have tried examples I've seen such as \localhost\myfolder\myApplication) I do, however, run my own website through a NameCheap host where I could provide a link to the application for users to download. I'm not quite sure how to set this up though.
I do not want the users to install from a CD
I don't know how to do the File Share method
This is the first obstacle. Regardless of what I choose, I cannot get the setup to work. I think the big issue is that I can't find how to include my Assets in the project and I don't know where to install the application.
The next obstacle, is that when users download my application, I would like to be able to push out an update, and have them have the update automatically (or only need to restart the application to get the update). I do not want them to have to re-download the application every time there is an update, as there are updates several times per week.
Again, I believe ClickOnce handles this but since I cannot even get to this step, I am not sure.
So, in the end, this is the use-case:
User is able to download the application from a website. Once application is downloaded, all further updates to the application are pushed automatically or only require a restart of the application to obtain.
I have gone through all the documentation on ClickOnce as well. Specifically this link. My issue is on #4.
I hope you are able to help, thank you!
Sharing the installer should not be an issue you could simply do that through Dropbox.
You can host your Updater on Dropbox as well but anytime you have new Updater replace the old one so the web link remains same and that it is because you need to know the the Updater link in advance to put it in the original installer.
You mentioned that you have a website through NameCheap, I believe you could use that instead of Dropbox here is a youtube links that might help.
https://www.youtube.com/watch?v=PEXcWln2Fe8
https://www.youtube.com/watch?v=rUNQphoGVwQ
I personally don't use ClickOnce but I use A Microsoft Windows Installer and I develop my own updater. ClickOnce is easier use for you at this point but later in future, you could explore other ways.
Wish my answer is clear if not just let me know,
Good luck

WPF Application Slow Unresponsive when demonstrating using remote sharing software

After spending 14 hours on this I think its time to share my woes and see if anyone has experienced this issue before.
Ill describe the issue and tests I have done to rule out certain things.
Ok so I have a WPF application which loads in data from an SQL database.
I am using DevExpress Components for datagrids, ribbons etc.. and FluentNhibernate to provide a session for database operations. I am also using log4net to log events to a textfile.
Using the application on my laptop with SQL Express 2008 works fine.. the application starts up, retrieves 1000 records and I can tab through the controls on the ribbon.
Now, I decided to demo the application to a third party and used remote login/sharing software online to share my desktop with the other person so as I could load the application on my laptop and they could view me using the application.
Now, the application takes approx 45 seconds to load... 30 seconds with a blank database where as, when im not sharing out my screen using the online software the application loads in about 7-10 seconds. As well as that, even using the controls in the application during the demo were very sticky, slow and unresponsive.
During the sharing session though however I was able to use other applications without any problems.. everything else worked fine.
But I cannot understand how my application works ok under normal conditions , even browsing the net at the same time etc... BUT totally fails to perform correctly when I am sharing a session with another user... the CPU usage shot up to 100% too at times when the application was trying to start up...
Please see below a list of 3rd party dlls I am using as references in my project.
DevExpress dlls
FluidKit
PixelLab.WPF
PixelLab.Common
Galasoft WPF Kit
FluentNHibernate
NHibernate
Nhibernate.ByteCode.Castle
Skype4ComLib
TXTEXTControl
log4net
LinqKit
All of these DLLs are in the output folder with the application dlls created from the class assemblys in the project. So when installed via an installer on a machine the dlls will be in the same application folder as the application file itself.
Many thanks
I saw something similar about a year ago with logmein. The performance is not the app its the graphics processing . WPF renders graphically in a completely different way then GDI winforms see around 2.3 and down msdn article. Many remote desktop application have trouble rendering this correctly particularly if you don't use the plug ins (say logmein). You didn't say what you were using but I would suggest trying a few different RDP options as there are many out there, and making sure your on the newest versions.
Yes, as bumle-bee-tuna points out, WPF will default to software rendering over Remote Desktop. Another way may be to screen share using Skype or similar. This means you'll be rendering the app locally but transmitting an image to the remote user. the app should work at full speed and the only lag the viewer will see will be introduced by the Skype network. I've used this technique many times to deliver presentations remotely and works well!

c# application working on development machine, fails on non-development machine

this problem has me baffled.
I'm writing an application which is supposed to take information from a form, pass it to a background worker which then a) writes the information to a local xml file and b) inserts the information into a remote MySQL database.
On my development machine, it seems to work flawlessly. The remote database is updated, the xml file is created if necessary and updated if it already exists. It's working.
Even if I exit out of the development environment and run the release build independantly of the IDE sandbox, the code works.
But, if I put it on another machine, the code fails and I dont understand why.
I'm currently using Visual Studio 2010 Professional on a 32 bit Windows 7 Ultimate machine.
At the moment, I'm finding that the application is stopping at a fairly specific point, which seems to be precisely where the background worker starts doing things like accessing the file system or accessing the remote database.
The project consists of a single exe file and a dll, which has a custom control I designed in it. The custom control is working fine, in that it shows what I want it to and returns the values I'm asking it to when I want it to, so it would seem that isn't to blame.
I initially thought I could be looking at a permissions problem, but running the application as administrator gets me the same response.
I've been writing using version 4 of the .NET framework, however I've just downgraded that to version 3.5 in the hopes that that may help. Both the non-development machines I've tried have been up to date - or have been brought up to date by me - prior to attempting to run the application.
I'm honestly baffled here. Any suggestions would be most welcome.
Alan
If your code fails, it most likely means there is some uncaught exception. What you should do is to log all uncaught exceptions (and probably some of the caught too) to a file, possibly using something like log4net.
I don't think we can help you beyond that.
I have written a live logging utility called Donsole for diagnosing the application in such conditions. On the developer workstation, it is very easy to diagnose using the feature-rich debugger of VS. The utility app. helps the developers exactly in this kind of scenarios where they don't have any idea what's happening inside. I recommend you download the latest build and try it for yourself. Explaining how to use this utility and how it works is beyond the scope of this answer, so I'd forward you to the codeplex page of the project.
http://donsole.codeplex.com/
This is how it looks.
Take a look at the event viewer of your operating system. Administrative Tools>Event Viewer>Windows Log>Application.

Visual Studio 2008 C#: Auto-Increment Version numbers

From what I'm seeing online, it seems the only thing in VS that auto-increments the Version numbers is if it's a website. For applications, it seems you either manually have to do it or you have to have a post build event and call a function or small app to do it for you. But, that's only what I'm seeing when I google it and when I've tried messing around with it myself. My questions are:
Can an application auto-increment the version number on a successful build without having to do the afore mentioned? Like a checkbox hidden deep in VS or something?
If no, is there a way to Publish an application rather than it being published as a website?
If it can, is that even the write way to go?
I know I've seen some instances where you can use the install package to increment the number, but my boss would like to start seeing how many times we build the applications so he can show to our customer the work being put into the application. If anyone can help me, that'd be great. Hope you all are having a good day. Thanks.
my boss would like to start seeing how many times we build the applications so he can show to our customer the work being put into the application.
Why not just publish your change logs and/or bug/feature database?

Categories