Giter Club home page Giter Club logo

f0rc0sigan / opensilver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opensilver/opensilver

0.0 0.0 0.0 36.91 MB

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.

License: Other

JavaScript 1.66% C# 97.49% PowerShell 0.06% CSS 0.12% HTML 0.10% Batchfile 0.07% Rich Text Format 0.31% Visual Basic .NET 0.17% ASP.NET 0.02%

opensilver's Introduction

This repository contains the source code of the 2 following products, which share most of their code:

  • OpenSilver (www.opensilver.net) → It compiles C#/XAML/.NET to WebAssembly/HTML/CSS (Free, Open Source, MIT Licensed)
  • CSHTML5 (www.cshtml5.com) → It compiles C#/XAML/.NET to JavaScript/HTML/CSS (Dual Licensed)

The main branches are:

  • develop: this branch is where day to day development occurs
  • master: this branch corresponds to the version of the packages that are on Nuget.org

How to download the software and get started?

Read the "Getting Started" page of the OpenSilver documentation for a step-by-step tutorial.

Basically, you should download the .VSIX file (the extension for Microsoft Visual Studio) which installs the Project Templates:

Then, launch Visual Studio, click "Create a new project", and choose one of the installed templates.

After creating the project, you may then want to update the NuGet package to reference the very latest version (note: in the NuGet Package Manager, be sure to check the option "include pre-releases", otherwise you may not see the latest package version).

How to build the source code in this repository?

  1. Update Visual Studio: Make sure you are using the very latest version of Visual Studio. To check for updates, please launch the Visual Studio Installer from your Start Menu.

  2. Clone the repo: Clone this repository locally or download it as a ZIP archive and extract it on your machine.

  3. Run the restoration .BAT: Execute the .BAT file "restore-packages-opensilver.bat" located at the root of this repository.

  4. (First time only) Update the OpenSilver compiler assemblies: OpenSilver has a dependency on an older version of OpenSilver to convert xaml files to C#, which is retrieved by the restore batch file (from Step No. 3.). Due to continous updates, this restored version can sometimes have outdated OpenSilver compiler assemblies which might cause unexpected compilation or runtime errors. To fix this, you should rebuild the Compiler.OpenSilver project and replace the assemblies "OpenSilver.Compiler.dll", "OpenSilver.Compiler.Common.dll" in the folder "src/packages/OpenSilver./tools/" (or "src/packages/OpenSilver.UWPCompatible./tools/" if you are working with the UWP configuration).

  5. Delete bin/obj: Make sure to remove the "bin" and "obj" folders, if any. They can cause issues when building using the ".bat" files.

  6. Launch the Developer Command Prompt: Open the "Developer Command Prompt for VS 2022" (or whatever is the latest version of Visual Studio) from your Start Menu and navigate to the "build" folder of this repository.

  7. Run the compilation .BAT: Launch the file "build-nuget-package-OpenSilver-private.bat" located inside the "build" folder of this repository, and enter today's date or any other unique identifier to use for the version number (eg. 2023-10-18).

  8. Use the newly built packages: The previous command will create new NuGet packages inside the "build/output/OpenSilver" folder. You can now reference those packages from any OpenSilver application project (here is how) (Note: you may need to check the options "Include prerelease" in the "Manage NuGet Packages" window in order to see the newly created NuGet packages). For example, to use them on a new "Hello World" OpenSilver application, make sure you have the VSIX installed (see the top of this document), then launch Visual Studio, click "Create a new project" -> "OpenSilver application", and replace the default NuGet package references with the new packages that you have built.

For convenience, instead of re-building the whole packages every time that you make a change to the OpenSilver code, you can build only the OpenSilver Runtime DLL, To do so, open the solution file "OpenSilver.sln" and choose the appropriate "Solution Configuration" (see list of configurations below).

To reduce the development inner loop time, you can also add a "Post Build" action to the OpenSilver Runtime project that will automatically copy the Runtime DLL from the "bin" folder into the OpenSilver NuGet package folder at "C:\Users\YOUR_USER_NAME.nuget\packages\opensilver\ENTER_LATEST_VERSION_HERE\lib\netstandard2.0"

Note: while rarely needed, there is also a .BAT file for building the Simulator package.

What are those solution configurations?

    OpenSilver configurations:

  • SL: Uses the Silverlight-like dialect of XAML.
  • UWP: Uses the UWP-like dialect of XAML.

    CSHTML5 configurations:

  • Debug: Uses the UWP-like dialect of XAML.
  • Migration: Uses the Silverlight-like dialect of XAML.

Note: the legacy "WorkInProgress" configurations have been removed as the unimplemented members have been merged into the current configurations.

What if I get a compilation error with the code in this repository?

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" and attempt to compile it with the latest version of the Visual Studio IDE.

If you are compiling using the Command Prompt, please double-check that you are using the "Developer Command Prompt" instead of the standard Command Prompt, and that the current directory is set to the "build" directory of this repository, because some paths in the .BAT files may be relative to the current directory.

If you still encounter any issues, please contact the OpenSilver team at: https://opensilver.net/contact.aspx

opensilver's People

Contributors

barjonp avatar cshtml5 avatar maillard-sylvain avatar jacob-l avatar roman-pikulenkor avatar ashotkhachatryan avatar avdynut avatar keyurjp avatar kernel-coder avatar thiagoftanaka avatar ousspero avatar ahmed-salem-me avatar bstoinev avatar rezarick avatar pymendoza avatar dvs99 avatar jtorjo avatar doomky avatar mbaykalos avatar cyphall avatar vsteeph avatar guillaumejuste avatar manvindersingh avatar andivlad-talentia avatar julru77 avatar bamby084 avatar giovanni-a avatar rankingsw avatar muratbayindir avatar iso8859 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.