question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stringinterpolation requires langVersion in .NET 5

See original GitHub issue

Describe the bug If I want to use string interpolation from F# 5 in a new .NET 5 project, I get an error in the editor that tells me, that string interpolation is not available in F# 4.7. As far as I know, F# 5 is now the default language version and dotnet build runs successfully without this error.

To Reproduce Steps to reproduce the behaviour:

  1. Use string interpolation in an net5.0 project without LangVersion
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
    <RootNamespace>test</RootNamespace>
  </PropertyGroup>
let test = "test"
$"%s{test}"

Expected behaviour I would expect that the language version is the same for editor and compiler.

Screenshots string_interpolation

Environment (please complete the following information):

  • OS: Windows (but inside of a mcr.microsoft.com/dotnet/sdk:5.0-focal dev container)
  • Ionide version: 4.17.0
  • VSCode version: Version: 1.51.0 (user setup)
  • dotnet SDK version: 5.0.100
  • mono / .Net Framework version: -

Additional context I created a reproduction repo here: https://github.com/NicoVIII/repro-bug

I don’t rule out that I do something wrong. If this is the case: Sorry!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
baronfelcommented, Nov 11, 2020

We’re actively working on this, you can follow the status here: https://github.com/fsharp/FsAutoComplete/pull/656

2reactions
Krzysztof-Cieslakcommented, Dec 14, 2020

This is fixed in Ionide 5.0 preview

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature 'interpolated strings' is not available in C# 5. ...
I moved a class from a newer project into an older project. Both were targeting .net 4.6 however after the move I received...
Read more >
string interpolation - format string output
You can learn about the requirements to build an interpolated string handler in the language specification for interpolated string improvements.
Read more >
C# String Interpolation
NET 6, we have to use <LangVersion>preview</LangVersion> in the project file. Working With Cultures. When we use the interpolated string ...
Read more >
How C# 10 “fixed” string interpolation - YouTube
NET 6 completely change the way we think about them. Not only is string interpolation significantly more efficient now when it comes to ......
Read more >
C# 10 First Look: Constant string interpolation - Dave Brock
Constant string interpolation looks to be set for C# 10—let's take a look. ... This summer, we took a look at most of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found