How to change the "Output" folder location and structure

 

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

 

To change the Output folder location and structure, you need to add some properties to the CSPROJ file of your CSHTML5 application.

To do so:

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 one or more of the following properties to the CSPROJ file:

<Cshtml5OutputRootPath>Output\</Cshtml5OutputRootPath>
<Cshtml5OutputAppFilesPath>app-cshtml5\app\</Cshtml5OutputAppFilesPath>
<Cshtml5OutputLibrariesPath>app-cshtml5\libs\</Cshtml5OutputLibrariesPath>
<Cshtml5OutputResourcesPath>app-cshtml5\res\</Cshtml5OutputResourcesPath>

Default Values

Read below the meaning of each property.

WARNING: The content of the "app", "libs", and "res" subfolders of the "Output" folder is deleted at each rebuild. To avoid data loss, make sure to only specify locations that do not contain other files!

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

 

Reference

 - Cshtml5OutputRootPath:

This property lets you specify the location of the Output folder.

The default value is "Output\":

 <Cshtml5OutputRootPath>Output\</Cshtml5OutputRootPath>

Note: You can enter either a relative path, like the one above, which is relative to the "bin\Debug\" folder, or an absolute path, like the following one:

 <Cshtml5OutputRootPath>C:\MyAppOutput\</Cshtml5OutputRootPath>

Note: Entering an absolute path is useful for example if you want to host your application in an ASP.NET project, and you want the Output files to be automatically created inside that ASP.NET project.

IMPORTANT: Make sure that the path ends with a backslash ("\")

 

 - Cshtml5OutputAppFilesPath, Cshtml5OutputLibrariesPath, and Cshtml5OutputResourcesPath:

These properties let you specify the path of the "app", "libs", and "res" folders, relative to the Output folder.

Here are the default values:

<Cshtml5OutputAppFilesPath>app-cshtml5\app\</Cshtml5OutputAppFilesPath>
<Cshtml5OutputLibrariesPath>app-cshtml5\libs\</Cshtml5OutputLibrariesPath>
<Cshtml5OutputResourcesPath>app-cshtml5\res\</Cshtml5OutputResourcesPath>

For example, if you wish to revert to the structure that was in place before Sept 2017, you can use the following values:

<Cshtml5OutputAppFilesPath>.</Cshtml5OutputAppFilesPath>
<Cshtml5OutputLibrariesPath>Libraries\</Cshtml5OutputLibrariesPath>
<Cshtml5OutputResourcesPath>Resources\</Cshtml5OutputResourcesPath>

IMPORTANT: The paths must be relative to the Output folder.

WARNING: The content of the "app", "libs", and "res" subfolders of the "Output" folder is deleted at each rebuild. To avoid data loss, make sure to only specify locations that do not contain other files!

If one of the locations is ".", the whole "Output" folder will be deleted at each rebuild.

 

 

Contacting Us

Please click here for contact information.