I want to run the Quartz.net task only once - c#-3.0

I want to update the web api periodically. I did this using the quartz.net library and it works fine locally. But it doesn't work on the server. For example, I want it to run once an hour apart.
I need help.
I want to run the Quartz.net task only once.

Related

How to start and stop a web application and database in VSO with vNext tasks

I've setup Continuous Integration in my project hosted at Visual Studio Online.
Among other things, I deploy my web application to a test slot and test database and I run integration tests.
However, I don't need the test slot and database to be running all the time. I would like to start them both for the integration tests to run and stop them after my integration tests are done, all automated.
I played around with the Azure PowerShell vNext task, but I couldn't figure out how to accomplish this. Any help would be appreciated. More than the actual answer, I would appreciate a link with more information, if possible.
For the web app slot, you can add AzurePowerShell step in your build defition can create two power-shell script: one start the website via Start-AzureWebsite command before the build start and another one stop the website via Stop-AzureWebsite after the testing is finished.
For the database, you cannot stop it. Refer to this question for details: How do I stop and start a SQL Azure database?

shellscript deployments feedback/schedule

We have an enterprise web application which is deployed on s3/cloudfront. Deployments are mostly done at night for less impact to users (local application used mostly in the day).
Current deployment process is to execute a shellscript on server which uses some credentials stored as system env variables. Shell script internally uses grunt task for build and deploy to s3.
Problems
When we run shellscript and if there occured some problems, there is no feedback to one who is doing deployment if he is not looking at the console. Whats the easiest way to implement a feedback system like email if deployment fails.
If we can implement a feedback system, can we do unattended scheduled builds using some tools like jenkins or some other tool.
You could create a rake task which executes your deployment script using popen (http://www.rubydoc.info/stdlib/core/IO.popen) and then send you the results of the command execution (and returnstatus)
This way you could automate the rake task execution via cron or whenever gem (if available) or something alternative like clockwork gem (if you're on a PaaS f.e.)

Is Quartz.Net appropriate to run a long process started from an ASP.Net 3.5 page?

I have a long running task (many hours) that is started via a web page on an intranet interface. This is an ASP.Net 3.5 project. Of course, I could extend the script timeout and let the page run for several hours, but I don't think this is a clean solution. I read somewhere that long running tasks should not be children of a Web Application Pool, since it could be reset by IIS at any time. Searching for a solution, I read a bit about Quartz.Net, but most examples are talking about recurring jobs. I was wondering if it were also appropriate for tasks that should run only once when a user asks for it. Or is there another better solution?
Also, if Quartz.Net is a good way to go, should it run as a Windows Service, or should it be spawned by the ASP.Net web site using Global.asax?
Quartz.net works just fine for this scenario. You schedule a one time job on Quartz.net and let it run for as long as it needs to. At work this is exactly how we run many of our jobs.
You should set up Quartz.Net as a windows service though. IIS recycles web apps and if you run Quartz.net within your web app it will get recycled along with you web app by IIS.

Why do we need to restart the CRM server after registering the custom workflow using Plugin Registration tool to make that work properly

Can we have any alternative way to make run-able the custom Workflow activity in Workflow steps.
All the time what I do is register the dll using Plugin registration tool and then restart the server. Then only we can use the custom workflow activity on Workflow.
I have tried after restarting the IIS and hoping so it'll be done but no luck.
All the time restarting server should not be any solution. Is there any alternative way for it please suggest. All you are suggestion would be greatly appreciated.
1) You do not need to restart IIS; restart the application pool (its far faster and doesn't disrupt other applications that might be running on the server; by default its the 'CrmAppPool') using the command:
%systemroot%\system32\inetsrv\appcmd recycle apppool CrmAppPool
2) Similarly, you can recycle the async process by running (powershell):
Restart-Service -displayname "Microsoft Dynamics CRM Asynchronous Processing Service"
3) Both of these commands can be run remotely using the powershell command:
powershell Invoke-Command [CrmServerName] -ScriptBlock { ["Restart-Service...."] }
4) You do not need to deploy to the server to debug plugins. Its far easier/faster to create a test harness. The link below outlines how to setup a dev environment for unit testing.
How I develop and unit test CRM 2011 plugins
CRM caches the dlls, restarting the services causes it to refresh those caches.
If you register a synchronous plugin then you need to reset IIS.
If you register an asynchronous plugin or custom workflow activity you need to reset the asynchronous service.
We don't need to restart the server to make it run the plug-in code, the only thing is you need to restart IIS after that.
Try restart IIS and then restart the asynchronous service, this must be the only thing necessary.
The point here is very specific -
It's not only true for the CRM, but is also true for any web application hosted on IIS. Web App (CRM for you case) caches dlls for the very first time when the message is executed (plugin message/event - Although this is done by .net platform internally, so to address the other similar calls more efficiently.). So, in that case you need to flush off the synced thing from your web app. And that is why you need to recycle app pool (SMART WAY -> for single application flush, and without impacting other applications on the server, you should always go for APPPOOL Recycle instead to IIS restart.)
For this, what I would suggest you is to write a powershell script to recycle AppPool for your application and trigger it on Post build event of your project (plugin project) in VS. So, that will make your process automated and will reduce your efforts to much lesser.
Regarding custom WF assembly, Since it executes under Async. Service, so you need to discard off the cached content from here as well.
Hope this helps!
You shouldn't need to restart anything.
What you need to do is increment the build number of the assembly you are updating each time you deploy it.
This makes sure that CRM knows not to use it's cached version but to load the updated one the database
If you want to see the CWAs without any need of restarts just select the activity in the plugin registration tool and press the "save" button below the properties

Jenkins - trigger builds automatically after server restart

Is it possible to trigger Jenkins to run jobs after server is restarted (that is, when Jenkins is started, for example)?
I thought this would be pretty simple but haven't found answer with brief googling.
Backround is that our Jenkins automatically deploys two Play applications after their tests pass at the same server for test use. (For both applications, we have a test build that triggers deployment build). Now it would be nice that applications would be up and running after server reboot.
There is an app... err plugin, for that :)
https://wiki.jenkins-ci.org/display/JENKINS/Startup+Trigger