We are excited to inform you that the fifth public Preview release of CSHTML5 2.0 - now powered by Bridge.NET - is available for download!
IMPORTANT: Before updating any of your existing v1.x projects to v2.x, be sure to make a backup copy first.
Where can I download it from?
DOWNLOAD:
You can download the VSIX installer for v2.0 Preview 0.5 (Alpha30-045) (for VS 2015 or newer) here.
Note: you can safely install the versions 2.x side-by-side with the versions 1.x. In other words, you do not need to uninstall the versions 1.x in order to install the versions 2.x.
To enable Simulator debugging: please check the options "Suppress JIT optimization on module load (Managed only)" and "Use Managed Compatibility Mode" in the Visual Studio options (menu "Tools" => "Options" => "Debugging" => "General").
How to try it out?
- Install the VSIX above (for VS 2015 or newer) (the download link is above)
- It will add a new category to the "New Project" dialog named "CSHTML5 v2"
- Create a new project using one of those new project templates (see screenshot below)
- Build the project
- Go to the "bin/Debug/Output/" folder and launch "index.html"
To update an existing project from CSHTML5 version 1.x to version 2.x:
- Please be aware that this action cannot be reverted easily. Therefore, we strongly recommend you to make a BACKUP copy of your project before updating it to v2.x.
- Go to the NuGet package manager, and add a reference to the latest version of the NuGet package named "CSHTML5" or "CSHTML5.Migration" (depending on whether you are using the normal edition or the "Silverlight Migration Edition"). Note: if you don't see it in the list of available packages, it's because you must check the option "include prerelease" next to the search field.
What's new since the Preview 0.4?
- Updated Bridge.NET from version 1.4.0 to 1.7.0 (please refer to the Bridge.NET changelog for details)
- Added support for "DoubleAnimationUsingKeyFrames" (previously, only "DoubleAnimation" was supported)
- Added the option "ValidatesOnLoad" (at the binding level) to make the validation hints appear immediately, even before the end-user clicks "Save". Here is an example of use:
<TextBox Text="{BindingPath=Email, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true, ValidatesOnLoad=true}" /> - Fixed "Debug.WriteLine" when running in the browser (the output now goes to the browse console)
- Changed some modifiers from "internal" to "public" to make it easier to extend CSHTML5 from other assemblies
- Fixed an issue that caused rectangles in a canvas to not be properly vertically aligned
- Fixed an issue with browser caching that prevented the app from being properly refreshed on the end-user computer when a new release was deployed
- Fixed an issue that prevented loading resource files (images, etc.) when the name of a folder contained spaces or other special characters
- Fixed ".resx" files support in the Silverlight Migration Edition (the NuGet package named "CSHTML5.Migration")
- Fixed ".resx" files support when the assembly name contains a dot, or when the ".resx" is located in an assembly other than the startup assembly, or when the assembly name is different than the project name
- Fixed "Hyperlink.TargetName" when a relative URI was passed as an argument
- Added support for single quotes in markup extensions (example: {ConverterParameter='this is a string inside single quotes'})
- Fixed an issue with Dictionary deserialization (Bridge-based version)
- Improved Simulator support
What are the benefits of the 2.0 version?
- Whole new engine to convert C# to JS: now based on Bridge.NET instead of JSIL
- Better performance; Much faster load times; Smaller footprint; Minification
- Source maps (to debug in C# while running in the browser)
- Support for build servers and VSTS (Azure DevOps) for continuous delivery
- Support for newer C# versions (up to C# 7.2)
- Distributed as a NuGet package (and a .VSIX setup for project templates and design-time VS integration)
- Improved Mscorlib support, and errors are now also reported at Design-Time rather than Compile-Time
- Easier interop with JS frameworks (Angular, React, Vue...)
- Better leveraging of the browser cache
- Lots of bug fixes (support for "Post Build" event, support for the "dynamic" keyword...)
What are the known issues?
- The Simulator sometimes displays errors that do not happen when running in the browser (WCF warnings, DataContractSerializer error, Application.GetResourceString...). To test in the browser instead, please click "Run in browser" from the Simulator, or open the file "index.html" located in the "bin/Debug/Output" folder.
- The XAML Inspector (to debug the Visual Tree) may not work properly yet
- The XAML Editor being used is the one from CSHTML5 v1.x (not available on VS 2019 yet)
Some regressions compared to v1.2 are expected while we are in this Preview phase.
Please report any issues as separate forum threads, so that we can easily track them and mark them as pending/solved.
We hope that you will enjoy this release and we thank all the people and companies that have helped us to make it possible.
Regards,
The CSHTML5 Team
Attachment - the "New Project" dialog:
Attachment - how to enable Simulator debugging: