|Overview & FAQ|
Welcome to the C#/XAML for HTML5 documentation.
We keep adding new content to the documentation on a regular basis. If you have a specific topic that you would like mentioned here, please send us an email to: email@example.com
This topic contains the following sections:
The generated apps can run natively on any web browser, without the need for any plugin or installation, and they can also be packaged as stand-alone apps for iOS and Android.
You download and install C#/XAML for HTML5 from http://www.cshtml5.com
It will add a new project type to the Visual Studio "New Project" dialog.
You create a new empty project of type "C#/XAML for HTML5".
It is a special kind of project that supports a subset of Silverlight/WinRT.
* Note: Apple requires users to have access to a Mac or to have a valid PhoneGap Build subscription in order to be able to compile apps for iOS or to publish them to the Apple App Store. This requirement applies to all the solutions in the market.
CSHTML5 is currently the only tool that lets developers build truly cross-platform apps using only standard C# and XAML with Visual Studio.
Apps cannot run in web browsers, nor can they run on platforms such as Linux, ChromeOS, Tizen, and more.
The XAML language used in Xamarin.Forms is very different from the XAML used in Universal Windows Apps, Silverlight, WPF, and Windows Phone. The names, properties, and methods are different.
Extending the built-in features requires coding natively for each individual platform. In contrast, CSHTML5 allows extending the built-in C#/XAML/.NET features by writing custom JS/HTML5 code that works on all platforms.
Apps are not XAML-based.
C# code can only be executed on the server, not on the client, so it is not possible to write apps in C# that can run offline on mobile platforms such as iOS or Android.
TypeScript and other solutions:
They are not based on C#, XAML, and the .NET Framework, so they don't allow to reuse the existing skills and codebase, to share code between the client and the server, to migrate Silverlight apps, etc.
Because with C# and XAML you can:
Use your existing development skills.
Port Silverlight or other existing apps to the web.
Share C# code between the client and the server.
Leverage the power of .NET and XAML (user controls, binding, data templates, type safety, async/await, linq...)
Share code with projects of other types (WPF, Windows Phone, Universal Apps...)
Extend the reach of Universal Apps beyond the Microsoft ecosystem.
Create a new empty project of type "C#/XAML for HTML5". If your existing application is made of multiple Visual Studio projects, create one new project of type "C#/XAML for HTML5" for each of the projects that you are migrating.
Copy/paste the C#/XAML files from the original project(s) into the new project(s). Note: for C# files, instead of copying the files, you can use the "Add as link" feature of Visual Studio that enables you to share the same file between the original project and the new project. This is only useful for C# files, because XAML code does not allow compiler directives.
Comment out the portions of the code that are not supported. For C# code, instead of commenting out the code that is not supported, you can surround it with the "#if !CSHTML5" compiler directive, so that the original code remains intact. For best productivity, we recommend an iterative approach, where you start with almost all the code commented out, and you progressively include the code into the "C#/XAML for HTML5" projects while at the same time verifying that it compiles properly.