Stringinterpolation requires langVersion in .NET 5
See original GitHub issueDescribe 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:
- 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
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:
- Created 3 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We’re actively working on this, you can follow the status here: https://github.com/fsharp/FsAutoComplete/pull/656
This is fixed in Ionide 5.0 preview