How to do try catch in Power Automate? (something like try catch)
I have a Power Automate process (cloud, not desktop), It works well, but some times fail.
I want to get some notice when my process fail. How to do it?
There is some recommended pattern to do Try.. catch.. finally from the community using Scope control block. Read more
Related
So I have been doing some research on how to programmatically schedule a task, and as of now I haven't really found anything that useful or informative on it. It could be because I am searching for the wrong thing, but thats why I am hoping you guys can help me out.
Here is what I have :
I have a C# Windows Forms Application created in Visual Studio 2013... ideally what I had in mind was to create a button that opens up a form and allows the user to schedule a time and frequency of a task and then set it (if that task already exists, update it).
So I was looking at the ITaskScheduler, but I am really clueless as to how I can use it and implement it. Not sure what assemblies I need to import etc... Was looking at this Link on pinvoke
However, if that cannot be done I am open for any suggestions. I am experienced in C/C++, and I know I have seen a few methods for C++ but nothing that looked very promising.
Here is the alternative I was thinking :
Simply just create a different program and then just schedule the .exe to run when I want.
As of now I am leaning heavily towards this method, but I am relatively new to programming in Visual Studio. However, I am an experienced programmer.
My question on this is... what would be the preferred method of creating this program? Would it be creating a Windows Form Application or a Console Application or just a plain empty project with a Main() method
So if you guys can shed some light on this subject for me that would be greatly appreciated.
Personal opinion:
If the tasks are few and not that often, I would use a Windows Scheduled Task. To keep things compact, the task could run the same .EXE that created the task, but with different parameters.
If there are going to be lots of little tasks running throughout the day which need to be tracked, logged, etc, I would probably create a Windows Service to run them, and a seperate front end for user interaction.
The easiest way would seriously be to use a Cygwin cronjob. First, install Cygwin with cygrunsrv. Then:
sudo crontab -e
*/5 * * * * /path/to/your/shell/script.sh
This would run every five minutes but you can tinker with the schedule as you see fit.
The crontab file is just a text file so users should be able to edit it through a Visual Studio application.
For my (performance) webtest I am using Visual Studio 2010. I perform this test from different domains and machines. Not all machines have access to the internet (except the preferred domain), however sometimes the test wants to call go.microsoft.com. Is there a way to catch this from the results (so it will not give an exception and failed result).
I tried changing the hosts file, however this is not possible on all environments. Any other solutions?
Thanks in advance
Fixed this with a NoFollow of redirects in the performance script, however if there are other possibilities I would be glad to hear them
( Hi, everyone. I'm very new to Windows programming, so I apologize in advance if this has already been asked and I just didn't know what to search for, but this problem has been driving me crazy and I know someone could probably answer this really easily. )
My company has an application that runs as a service in Windows 7. I have been tasked with writing code to change display settings, but I apparently cannot do this from a system service. I created a small executable that changes the color depth to 8bpp in about 5-10 lines of code, but when I place this code in my application, it returns success yet does not actually succeed (nothing changes).
Without a commanding knowledge of how Windows programming works, I have managed to try a MILLION different things to get it to work but with no avail. Can somebody PLEASE help me find what I need to do to make this code function?
On Vista and upwards services run in a different session (session 0) and are isolated from the interactive desktop(s). This means that code that you run from the service is simply unable to make the changes you want. The obvious conclusion is that you need to run code in the interactive desktop.
Now you can do this, but it's not exactly easy to achieve. What you will need to do is arrange for your service to launch an process that runs on the interactive desktop: Launching an interactive process from Windows Service in Windows Vista and later. That process, rather than the service, is what will have to make the changes.
Whilst it is possible to achieve what you want, I think you should regard the difficulties involved as a signal to review whether or not your proposed approach is the best solution to whatever your underlying problem is.
M 8.0.1, windows 7.
A debugging question.
Sometimes when I start M and open my notebook (which has dynamics enabled in it before I closed it) I get this message
The problem is, no matter if I click on wait, or disable dynamics, the message keeps coming back.
I have to terminate the process itself (i.e. Mathematica) from windows task manager to get out of this.
Clearly I seem to have a bug somewhere in dynamics in my code.
My question is: Is there a way for M to tell me which dynamic objects is causing this problem? And any idea why telling it to disable dynamics updating is not helping here (as I keep getting the message).
thanks
You may have some luck by evaluating:
SetOptions[$FrontEnd, PrintKernelDynamicTraffic -> True]
This will cause the Mathematica FrontEnd to print messages to the system console (on Mac, I don't know where it goes on Windows) whenever it sends Dynamic evaluations to the kernel. If you can find the last Dynamic evaluation to print out when the message appears, that should be the one which is taking a long time to evaluate.
You'll probably want to disable this when you're done debugging so it doesn't fill your system log with millions of debug messages.
You may find DebugTrace, written by David Bailey, useful. It is a debugger which may also be used to debug dynamic constructions. In this documentation there is an example on how to debug such programs. Basically you set a breakpoint in your code, run it, and after it's done you are presented with detailed information on what happened when.
In general I highly recommend giving it a try, not only for the dynamic functionality.
Basically I'm wondering if I can save myself updating my code with System.Diagnostics.StopWatch, and somehow just get away with using the debugging features of VS (2008 in particular)
I.e. if I put a breakpoint before and after my method call, and then 'run' it. Is there anyway to tell how long VS was running before it stopped again? (Other than staying at the station and looking at the computer's clock of course)
If the answer is yes, please explain how.
As far as I know, no such a feature is built into Visual Studio.
Rather try a profiler. EQATEC Profiler is free and does exactly what you want i.e. time spent in each method and it's really easy to use....
You can use DateTime.Ticks. Rather than setting a breakpoint save the DateTime.Ticks component in a temp variable. At the point of second break point use another variable to store the DateTime.Ticks component.
Now time elapsed is Variable2 - Variable1.
There are 10,000 ticks in a millisecond.
I got all excited about replying to this post, until I actually tried it and realized that .NET projects don't support the #CLK pseudoregister trick! This sucks.