[null, null, {"document_url": "https://tripwiretech.blogspot.com/2017/05/", "unformatted_src": "https://1.bp.blogspot.com/-wjo3WeSHKQw/WRFDQxgl73I/AAAAAAAAEds/xFOJKTYtvHIDUinRCUkRbI_hl-msze95QCLcB/s400/windows_service.PNG", "src": "https://1.bp.blogspot.com/-wjo3WeSHKQw/WRFDQxgl73I/AAAAAAAAEds/xFOJKTYtvHIDUinRCUkRbI_hl-msze95QCLcB/s400/windows_service.PNG", "formatted_filename": "windows service", "rendered_width": 400, "rendered_height": 277}, null, {"document_url": "https://tripwiretech.blogspot.com/2017/05/", "unformatted_src": "https://3.bp.blogspot.com/-pR3Y2fQbV8w/WRFPJAYI6CI/AAAAAAAAEd8/IAgPZEQr8uwAgI19tBtAwh0aRtpJ2ekxACLcB/s1600/Properties.PNG", "src": "https://3.bp.blogspot.com/-pR3Y2fQbV8w/WRFPJAYI6CI/AAAAAAAAEd8/IAgPZEQr8uwAgI19tBtAwh0aRtpJ2ekxACLcB/s1600/Properties.PNG", "formatted_filename": "Properties", "rendered_width": 400}, null, null, null, null, null, null]


When you call an asynchronous method from your Main method of a console application in C#, you may experience the situation where your program runs to completion without hitting breakpoints following an await. An example of this is below:

The reason for this is that when Main exits the program exists, and any outstanding async operations are cancelled along with it. This can be solved by changing to to block Main from exiting. 



Polling services can be incredibly useful for picking up when something has changed and performing some actions. This post will cover how to set one up in C#. Firstly, you will want to create a new project with type Windows Service in Visual Studio: You will then want to rename Service1.cs and all its references to be something more representative of your polling service. You will also want to update the name the polling service will appear with by clicking on Service1.cs to open the designer, and then right click within the designer and choose "Properties", then update ServiceName in the Properties view. In order to view the code backing the polling service you can click on "click here to switch to code view" from within the designer. This code should look something like this:

You can put whatever you want in ProcessThings but personally, I add a console application project to the solution that handles all of the processing. This way I can debug it at will without the need to install the polling service/wait for the polling period.


Click on Service1.cs, then right click and choose "Add Installer", you can name serviceProcessInstaller1 and serviceInstaller1 whatever you like. Click on serviceProcessInstaller1 and select what account you would like the polling service to run with, I chose Local System which is quite common, and means that it is using the local user's account. After this you can build your project. To install it open the Developer Command Prompt for VS 2017 as an administrator and then navigate to where the .exe of your project is.

You can install using the following command:
Alternatively, you can uninstall using the following command:
Posted by Trip Wire at 17:07 No comments: 


Babel is a dependency that React Native has. Babel lets you write ES2016/ES6 and then it converts this to JavaScript (ES5) that will run on your browser. This is because at the current point in time, the latest version of all major browsers have interpreters that can interpret ES5.

ES2015 adds syntactic sugar to ES5, that can result in faster JavaScript development. It can also result in tidier more readable source code, although of course readability is heavily opinion based so ES6 syntax may not be for everyone. It aims to tackle some of JavaScript's shortcomings addressed by TypeScript/CoffeeScript. This means you can write lambda expressions, JSX, and other syntax available in ES2015.

To write ES2015 in React Native apps you don't need to do any additional work as it is configured by default. However, you can write straight JavaScript if you want to.


Try Babel
JavaScript and ECMAScript
Posted by Trip Wire at 14:55 No comments: Trip Wire
Web and mobile development is my passion. C#, Swift and JavaScript are my languages of choice.
