Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.7.2 and VS2013 issue with string interpolation #754

Open
StewUK opened this issue May 22, 2018 · 4 comments
Open

4.7.2 and VS2013 issue with string interpolation #754

StewUK opened this issue May 22, 2018 · 4 comments

Comments

@StewUK
Copy link

StewUK commented May 22, 2018

Hi

We're still using VS2013 here. And I'm getting

Unexpected character '$' when trying to compile a 4.7.2 project developed in VS2017.

It's to do with string interpolation.

throw new Exception($"Blah blah {name}");

Any pointers? Or is VS2013 now deprecated?

Thanks

@svick
Copy link
Contributor

svick commented May 22, 2018

String interpolation is a C# 6.0 feature. VS2013 only supports C# 5.0, so it's not surprising the code doesn't compile.

Is there anything preventing you from upgrading to VS2017?

@StewUK
Copy link
Author

StewUK commented May 22, 2018

Cost benefit mostly.

10 environments to upgrade is a significant cost to a small business for the benefit. Personally, I'd do it in a flash.

Thanks anyway for the information :)

@0xfeeddeadbeef
Copy link

@StewUK You can install Microsoft.Net.Compilers package into your project and be able to compile interpolated strings, but syntax highlighting and IntelliSense will be broken.

@dasMulli
Copy link

dasMulli commented May 23, 2018

Do note that recent versions of Microsoft.Net.Compilers require MSBuild 15.

You could also use JetBrains' MSBuild distribution to get all the necessary bits without needing any VS license (when you can't use Community and Build Tools require that you have a license).

You can also use VS Code with the C# extension to get an editing experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants