Wednesday, June 19, 2019

AWS Code Deploy Error: Make sure your AppSpec file specifies "0.0" as the version

I got this error when attempting to deploy using AWS Code Deploy. Checking the appspec.yml, it does have: version: 0.0. One of the suggestions in StackOverflow was the line ending has to Linux. However that did not help in my case. Since I'm deploying to Windows, the line ending has to be Windows.

After couple trial and error. I found out that Visual Studio save my appspec.yml with UTF-8 encoding, so I proceed to change it to "Western European (Windows) - Codepage 1252" encoding and code deploy works flawlessly.

To change the encoding, I use the following steps in VS2017:
1. Select the file in Solution Explorer.
2. Click File menu on Visual Studio
3. Select Save <filename> As...
4. On the pop up, click the tiny arrow next to the Save button
5. Select Save with Encoding...
6. I select Western European (Windows) - Codepage 1252 for the Encoding and Current Setting for the Line endings.


Monday, June 10, 2019

VB.NET Exit Sub Finally

I have a recurring VB.NET application that will start every 15 minutes. However, as a precaution, the next scheduled instance of the application will immediately exit if the previous instance is still running.

To keep track of the status of the application, I put a code in the finally block that will update the status to stopped and save it to the database.

I noticed that somehow the status of the application was stopped but the application still running in the task manager. There is no background worker so it should exit when the status is updated. It turns out that the subsequent instance update the status when it exited due to finally block is always executed even on "Exit Sub"