This repository contains the source of both OpenSilver and CSHTML5. More information is available at: www.opensilver.net and www.cshtml5.com - Read README.md for the instructions on how to build the source code and how to test it.
Basically, you should download the .VSIX file (the extension for Microsoft Visual Studio) which installs the Project Templates: - The .VSIX for OpenSilver can be downloaded from: https://opensilver.net/download.aspx (Free, Open Source, MIT Licensed) - The .VSIX for CSHTML5 can be downloaded from: http://cshtml5.com/download.aspx (Dual Licensed)
Then, launch Visual Studio, click "Create a new project", and choose one of the installed templates.
In the newly-created project, you may then want to update the NuGet package to reference the very latest version, in order to be sure that you have the same version as the one in the "master" branch of this repository (note: in the NuGet Package Manager, be sure to check the option "include pre-releases", otherwise you may not see the latest package version).
The "Runtime" corresponds to the assembly that is referenced by your application project. It is the assembly that contains most of the interesting code of this repository. In particular, it contains the code for the UI engine, the XAML controls, the framework classes, and more.
To compile the Runtime source code, follow these steps:
Clone this repository locally or download it as a ZIP archive and extract it on your machine
Execute the .BAT file "restore-packages-opensilver.bat" or "restore-packages-cshtml5.bat" (depending on whether you are using OpenSilver or CSHTML5)
Launch Visual Studio 2019 or newer
Open the solution file "OpenSilver.sln" or "CSHTML5.sln" (depending on whether you are using OpenSilver or CSHTML5)
Choose the appropriate "Solution Configuration" depending on your needs:
For OpenSilver, you may choose the "SL" configuration for Silverlight-like dialect, or the "UWP" configuration for UWP-like dialect. Note: there is also a "SL.WorkInProgress" configuration that contains work-in-progress features. It is useful during migrations from Silverlight to quickly arrive to a point where the migrated project compiles.
For CSHTML5, you may choose the "Debug" configuration for UWP-like dialect, and the "Migration" configuration for Silverlight-like dialect.
Build the project named "Runtime"
If you wish to test the Runtime, start by creating a test project using the Project Templates (as described in the section "How to download the software and get started?" above). Then, update the NuGet package to reference the latest version. Lastly, copy/paste the assemblies that you just compiled from the "bin" folder of the "Runtime" project into the "lib" folder of the installed NuGet package (the one that is used by your test project). To know precisely where this folder is located, follow these tips:
If you are compiling the Runtime of OpenSilver, simply copy/paste "OpenSilver.dll" from the "bin/SL" folder into the folder: C:\Users\%USERNAME%.nuget\packages\opensilver\1.X.Y\lib\netstandard2.0
If you are compiling the Runtime of CSHTML5, simply copy/paste "CSHTML5.dll" from the "bin/Debug" folder into the the folder "packages\CSHTML5.2.X.Y\lib\net40" located inside the solution of your test project. Then, rebuild your test project and launch it.
Wait for the compilation to finish. The generated NuGet packages are created inside the "build\output\XXXXX" directory.
To test the NuGet package, simply reference it from your test project. If you are unfamiliar with custom package sources in Visual Studio, please read this page.
Building the VSIX is only useful if you wish to test your changes to the Project Templates, the Item Templates, or the XAML editor. For all the other scenarios, building the Runtime or the NuGet package is sufficient to test your changes.
Notes for building the VSIX: - Note for OpenSilver: while all the projects do build fine with VS 2015, the "OpenSilver.VSIX" project can only be opened and built with VS 2019 (or newer). When building it with VS 2019 (or newer), you can unload the other projects to avoid compilation errors due to the version of VS. - Note for CSHTML5: when building CSHTML5.VSIX, you may initially get a compilation error saying that some .nupckg files are missing. This is because the .nupckg files of CSHTML5 have not been uploaded to GitHub due to their large size. You need to manually download them and copy them into the folder that has the error. You can download those files from https://www.nuget.org/packages/cshtml5 and https://www.nuget.org/packages/cshtml5.migration
If you get a compilation error, it may be that a Visual Studio workload needs to be installed. To find out, please open the solution "OpenSilver.sln" or "CSHTML5.sln" and attempt to compile it with the Visual Studio IDE (2019 or newer).
If the error is about the generation of the .VSIX file, just ignore the error, because the .VSIX file is not needed for testing the NuGet package.
If you are compiling using the Command Prompt, please double-check that you are using the "Developer Command Prompt", not the standard Command Prompt, and that the current directory is set to the "build" directory of this repository, because the paths in the .BAT files are relative to the current directory.
If you still encounter any issues, please contact: - the OpenSilver team at: https://opensilver.net/contact.aspx - the CSHTML5 team at: http://cshtml5.com/contact.aspx