Using Roslyn compiler with Visual Studio 2013 - visual-studio

Is there a way to use the Roslyn compiler with Visual Studio 2013 so that I can take advantage of the new C# 6 features ?
Note: Using VS 2015 is not an option.

Yes, you can compile C# 6 code with Visual Studio 2013. You just have to install the Microsoft.Net.Compilers NuGet package and your code will build just fine (however, note that you need to target .NET 4.5+).
But, the IDE won't understand it. You'll get squiggles everywhere you try to use a C# 6 feature, because VS2013's internal "live" compiler is not the same. Working in such an environment on a daily basis will drive you insane in less than two weeks.
That said, if all you need is compiling C# 6 code, installing the NuGet package on VS2013 is a potential solution.

Related

Visual Studio 2010 express compiler

I would like to know if I can somehow compile c++ code in visual studio express 2010 with a 2019/2022 compiler. I only want to use express 2010 as an editor. I get no results on google regarding this topic.
Edit: I can change from platform toolset V100 to V90 but I'd like V143 like VS 2022. Is it possible though?
It is possible, but why on earth would you want to continue using Visual Studio Express 2010 as your IDE? VS2022 is so full of goodies and the community edition is free to use.
That being said: The VS2019/VS2022 compilers are just cl.exe, link.exe etc... You can use these compilers instead of the VS2010 cl.exe, link.exe etc... The VS2010 integrated build system will not automatically find them, so you'll either have to fiddle around with paths, get in to trouble with compiler switches etc...
You could switch to makefiles (or CMake) to use the compilers and keep the IDE. VS2010 is then no more than a fancy editor.
Tip: Try compiling your code from the command line (cmd.exe) to get started. Or download VS2022 community edition.

Fresh installed Visual Studio 2017 won't create C++ project with error 0x80041fe2

I just installed Visual Studio 2017 (current time: August 2018). I only need C++ so I picked C++ component and deselected everything listed in "optional" items. Then after the installation, I cannot even create any C++ projects including both console and desktop projects. It gives me a error dialog of "Exception from hresult 0x80041fe2".
I did a search online. This question, visual studio and qt: HRESULT: 0x80041FE2, seems close but it's QT related, so it's different.
I did eventually find a solution. Will answer my own question below.
It turns out this is probably a Visual Studio installation bug. The "Optional" components are really not totally optional. I then picked the following Optional components and then it works:
Just-in-Time debugger
VC++ 2017 version 15.8 v14.15 latest v141 tools
C++ profiling tools
C++/CLI support
VC++ 2015.3 v14.00 (v140) toolset for desktop
Almost certainly not all of these are needed. But I don't want to spend time to find out which "Optional" is actually not optional...

Visual Studio 2017 Won't run Custom Tool in .NET Standard Library

I'm porting all my development to Visual Studio 2017. I made heavy use of Portable Libraries in 2015, but it appears that .NET Standard is the way to handle cross-environment issues going forward. I've got a single file code generation extension that I've upgraded. In Visual Studio 2017, it works great against the traditional .NET libraries and portable libraries, but it doesn't work with the new .NET Standard library I'm trying to build. I'm happy to consider that I've done something wrong, but the GITHUB example doesn't work either:
https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/Single_File_Generator
Anyone know why Visual Studio extensions (at least code generation extensions) don't work on this project type?

How can we compile OpenHaptics v3.0 with Visual Studio 2010?

I want to compile my Haptic Application with Visual Studio 2010 but the Academic Edition of OpenHaptics v3.0 supports Visual Studio 2005 compiler only.
VS2005 doesn't have any problem I can compile and run my application with no issue, but due to other libraries I want to move to VS2010.
Is there any way that I could use VS2010 with OpenHaptics® v3.0. The only problem with hl.lib and hd.lib, I can recompile hdu.lib and hlu.lib with VS2010 successfully but I have no idea how can I compile hl.lib and hd.lib with VS2010.
I have been thinking to use vs2010 since 1 year but still no success, any idea ?
You can use the VS 2010 IDE with the VS 2005 build tools if you install Daffodil:
http://daffodil.codeplex.com

Which version of Visual Studio should I install?

I am going to install Visual Studio. I want to know if the latest version of Visual Studio 2010 is backward compatible with previous versions like VS 2005 and 2008. Or is the code functionality and deploy-ability more dependent on the .NET framework version.
I am trying to use a code which will be built into dll. I am not sure in which version of VS the code was written(most probably VS 2005).
Thanks...
I would suggest to go with the latest Version.
VS 2010 can target multiple frameworks.
http://msdn.microsoft.com/en-us/library/bb398197.aspx
So the dll should know with which framework it was compiled...
I have never found any issues with Visual Studio 2010 and previous versions' code. It also does feature significantly improved Intellisense and [IMHO] faster building.
they are all backward compatible
2005 and above allow you to target the framework you want when creating
the project
if the project is older
than the VS, it will prompt you with
a migration wizard upon opening
it(this is a one time only step.
Couple of things to note that i've found with 2010 which have caused us a couple of issues:
1) NHibernate (Castle Proxy) doesn't work with .net framework 4 (Currently)
2) Test Projects are always created aimed at .net framework 4, and you cannot target a lower version of the framework.
Otherwise not many problems, its also nice that the database addition of Visual Studio 2010 has intellisense on your tables/views, as well as many other changes
Always go with the latest, now 2010

Resources