In part 1 of setting up and creating the MotorDB application, Typescript was used.
To help demonstrate the application, it is hosted at appharbor However after appharbor pulled down the latest code from GitHub, the sample data was not being displayed.
Looking at the console, several errors are being displayed
What is important is the two 404 errors, The page cannot find the javascript files that are generated from Typescript. It appears that right now, appharbor is not compiling the typescript files.
To get the javascript files, needed to do the following steps.
- Within the solution folder, create a Tools\Typescript file.
- Copy all the typescript files from C:\Program Files (x86)\Microsoft SDKs\TypeScript and C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript to the Tools\Javascript folder. Remember if running on 32bit system, remember that there is no “Program Files (x86)” folder
- Open the ui .csproj file and modify the BeforeBuild target to include the following:
- <Exec Command=”"$(SolutionDir)Tools\TypeScript\tsc" @(TypeScriptCompile ->’"%(fullpath)"’, ‘ ‘)” />
- Make sure you have saved the typescript files so that Web Essentials will create the javascript files.
- In solution Explorer, click on “Show All Files” button
- For each generated javascript file, from the context menu, select “Include in Project” You can include both the regular and the minified file, or whatever one your code is linked to,
- For each file, select the properties can change the property “Copy to Output Directory” to “Copy Always”
Now when appharbor compiles your solution, the created javascript files will be copied, and you will no longer get the 404 errors
Leave a Reply