Skip to main content
Home  ›  Blog

2sxc 17.06 LTS - H-App-Y Easter!

2sxc 17 has it's first LTS (Long Term Stable) release. Start using the crazy new features like the precompiled AppCode.

2sxc 17 LTS

An LTS is a long-term stable release of 2sxc. This means that it has been well tested and that we'll provide short-term fixes for security issues or other critical bugs. 

This also means that you can start using the new features with confidence, such as:

  1. Use C# 8 (DNN) or C# 12 (Oqtane) in your Razor and other code, with IntelliSense
  2. Pre-Compiled AppCode
  3. Copilot and generated C# models for Content-Types
  4. The new Strong-Typed API
  5. Copilot generated C# Razor base classes
  6. Copilot generated C# Service base classes
  7. Copilot generated C# WebApi base classes
  8. New strong-typed Razor Models

Some new features in 2sxc 17 LTS are still beta. This means you can use them, but don't expect LTS resilience yet, and there may still be minor changes. This applies specifically to:

  1. New Pickers in the Edit UI (beta)

Use C# 8 or C# 12 and IntelliSense

2sxc 17 requires the installation of the CodeDom Extension in DNN (Oqtane already has the latest C#). Once you do that, we have the Roslyn Compiler which allows you to use C# 8 in Dnn. Read more in the C# 8 Blog Post.

The new coding style makes away with dynamic code, and together with new VS Code features, this allows 2sxc to provide IntelliSense while developing.

Read more about IntelliSense.

Pre-Compiled AppCode with HotBuild

Code placed in the AppCode folder is now compiled together using HotBuild and made available to Razor, WebAPIs and other C# code; though you probably won't have other C# code any more, since AppCode makes this obsolete.

This has loads of benefits, incl.

  1. Type safety. Since every C# code can now be used in a typed way...
  2. ...so no more fiddling with dynamic, GetCode(...) or CreateInstance(...)
  3. Compile time reliability since all that C# code is compiled together - and if it works, it works!
  4. Better split your code into many files (previously you had to put many classes into the same C# file to use them together)
  5. Improved performance after initial load, since everything is then already compiled

This allows you to create big, enterprise solutions with ease and confidence!

Copilot Generated Data Models, Razor and More

2sxc 17 introduces a new assitant which we'll call Copilot for now. 

It will generate C# Code like:

  1. Data Models for your Content Types
  2. Razor base classes with typed App.Settings and App.Resources
  3. C# service and WebApi base classes with typed Apps

In future it will do even more, but this makes it very easy to get started with strong-typed apps and double your coding efficiency.

Strong-Typed APIs

Using all the previously mentioned features, you can now use strong-typed Data Models, eg. like this:

@inherits Custom.Hybrid.RazorTyped
@using AppCode.Data
@{
var posts = App.Data.GetAll<BlogPost>(); // IEnumerable<BlogPost>
var current = As<BlogPost>(MyItem); // BlogPost
var mainImage = current.ImageFile; // IFile
}

There's a lot to this, check out https://go.2sxc.org/strong-typed.

Note that strong-typed APIs still work with the normal typed APIs, so method such as .Url(...) will continue to work. 

Strong-Typed Razor Models

Razor Models are the parameters handed in to sub-razor files. This used to be dynamic by design, and use helper objects such as DynamicModel (Razor14) and MyModel (RazorTyped). While this still works, you can now also use strict models such as is common in Razor elsewhere, like this:

@inherits Custom.Hybrid.RazorTyped<string>
@{
var x = Model; // string
}

This is more robust, but also less flexible. So you can use this or the older MyModel method, whatever you prefer.

H-App-Y Easter

Get it from GitHub releases, enjoy the new features, create awesome apps!

With love from Switzerland and Croatia,
iJungleboy & Tonci


Daniel Mettler grew up in the jungles of Indonesia and is founder and CEO of 2sic internet solutions in Switzerland and Liechtenstein, an 20-head web specialist with over 800 DNN projects since 1999. He is also chief architect of 2sxc (see github), an open source module for creating attractive content and DNN Apps.

Read more posts by Daniel Mettler