How to generate JavaScript during the build process rather than the Simulator

 

Note: this feature requires v1.0 Beta 12.5 or newer

 

Normally, the HTML and JavaScript files are generated by the Simulator rather than by the build process. This choice was made because the generation of HTML and JavaScript files sometimes takes a long time, so having the Simulator do it allows you test and debug the application while waiting for the generation to complete.

However, if you wish to generate the HTML and JavaScript files during the build process instead, this is possible.

To do so, please follow these steps:

1. Unload your CSHTML5 application project. To do so, right-click on your project in the Solution Explorer, and click "Unload Project":

Unload Project

2. Edit the CSPROJ. To do so, right-click again on the project in the Solution Explorer, and click Edit CSPROJ:

Edit CSPROJ

3. Add the following property to the first <PropertyGroup>in the CSPROJ file:

<GenerateJavaScriptDuringBuild>True</GenerateJavaScriptDuringBuild>

Here is screenshot that shows where to add that property:

Default Values

4. When you have finished editing the CSPROJ, reload the project. To do so, right-click on the project in the Solution Explorer, and click Reload Project.

 Reload Project

Now, every time that you build your project, the HTML and JavaScript files will be automatically generated in the "bin\Debug\Output" folder.

Note: the location of the "Output' folder can also be customized (see "How to change the Output folder location and structure").

 

Contacting Us

Please click here for contact information.