问题
I have been working at my current company for a little over six months and we're currently using Visual Studio 2012. We are going to start building a new application and I've been trying to get a commitment to a Visual Studio 2015 upgrade so that we can start with the latest technology. Unfortunately it's a small company and there are budgets to consider.
Does anyone know if C# 6.0 will be supported in Visual studio 2012. I'm thinking that, since it's about to become 3rd generation old it may not get support.
UPDATE:
I saw a lot of comments related to the community edition of VS2015 so I thought I would clarify my company's position regarding that version. The company has around 20 employees and a 6 person IT team who all need VS for various reasons. We also have over $1M sales so we can not qualify for community edition.
UPDATE 2:
Q: Is there some specific feature in C# 6.0 you can't live without?
A: Not any particular feature although property initializers and primary constructors will cut down on a lot of chaff in code.
回答1:
Yes, you can install c# 6.0 into VS2012 and VS2013 on a per project basis as a NuGet package. You'll have to install this package for every project that you want c# 6.0 features in.
https://www.nuget.org/packages/Microsoft.Net.Compilers/
Installing Latest C# Compiler via Nuget
Install-Package Microsoft.Net.Compilers
EDIT: As pointed out in the comments below, upgrade your NuGet to the latest version in order to ensure full compatibility with the nuspec file.
回答2:
Q: Does anyone know if C# 6.0 will be supported in Visual studio 2012.
A: No, absolutely not. For both technical and marketing reasons.
C# 6.0 is the latest/greatest/bleeding edge version of C# which will ship with VS 2015.
If you wish to use MSVS 2012, then you must write to C# 5.0 or lower. With assurances your code should be portable when you upgrade your compiler.
Q: Is there some specific feature in C# 6.0 you can't live without?
回答3:
You'll have to upgrade. You'll want to as well as the IDE gets changes that help with development and the new features.
You might consider Visual Studio Community (formerly VS Professional). When they release VS2015 I'd expect a release similar to VS 2012 Community.
See here for more information. Up to 5 devs can get a copy in a commercial company.
来源:https://stackoverflow.com/questions/28638547/c-sharp-6-0-support-in-visual-studio-2012