Dotnet 3 or 5 in education

Is there any way to make a C# assignment (repl) based on a newer framework? The DOTNET ecosysystem has quite evolved since the versions used on replit.

My students code primarily in Visual Studio and use the replit teams only for submissions (and sometimes also for smaller assignments) primarily because of the level of support, debugging tools, hinting etc. However, after installing Visual Studio 2022, all their C# projects are using top-level statements. For beginners this is perfect, there is no “unnecessary” code around, they can focus on their own statements only.

This feature is available since C# 9, with the new Visual Studio it is just “preferred for new projects”, but for my students this means that they cannot simply copy&pase to replit. They are also confused by the unexpected code around. Is there any way to create projects supporting C# 9 or even C#10 ?

  • Nowadays the standard option for a C# project (repl) in Teams is using the mono compiler, this is however quite outdated as mono is an almost dead technology (the latest supported version of the language is C# 6 C# Compiler | Mono)
  • It is possible to set up a nix project and manually create the project file and code file (https://replit.com/@turbio/dotnet) This is a step forward, but only brings us to C# 7.1 since the installed framework version is netcoreapp2.1 (unsupported by Microsoft, not even LTS, NET Core Releases and Support - .NET Blog)
  • I tried to modify the main.csproj file and change <TargetFramework>netcoreapp2.1</TargetFramework> to a newer framework version. Expectly this failed with a message : error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [/home/runner/abc/main.csproj] and a similar one for net5.0
  • There is a Dotnet 5 demo at https://replit.com/talk/templates/C-9-NET-5-template/121959 , however it is huge (hundreds of MBs - and I have more than hundred of projects) and extremely slow to run. I also haven’t found a way how to fork a standard repl into replit Teams to make it a project.

Is there any help for me how to setup a modern C# project in replit teams?

Any help appreciated

Hi @JanKoupil1 , We updated to dotnet 6 last week, so this should be all up to date!

Great news! Thank you!

Hi Jan,

Our default C#.NET project is now using DotNet Core 6. Is that sufficient for your needs?

If you provide me an example assignment, I am sure we can figure out how to make it work.

Thank you!

Hi @demc Derrick
I tried to dig in and investigate - things were magically changing under my hands this afternoon - at its beginning a new C# repl was using the mono compiler and NIX based repls were ignoring the “first time used” directive and clearing output console at their end.

Now a new C# repliit is a brand new one, C#10 based running in .net 6. Everything is working perfectly. That means - problem solved.

Just one more question: Is there any way to migrate an old repl to the new one?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.