I'm thinking about installing VS 2017 and using it for work. The free download is here.
So is Visual Studio 2017 RC backwards compatible with Visual Studio 2015 solutions?
The release notes mention it here. Just wondering if someone did this and if they had any issues.
EDIT (UPDATE)
I have been working with 2017RC now since 2/1/2017 and I verified it does not change the proj or sln files at all, not even when you add / remove files to the proj / sln (except to reflect the file changes of course).
IT'S SAFE TO USE IN A 2012/2013/2015 SHOP!!!
It depends on the type of project.
For most (standard) types, for example web projects (Full .NET Framework), Windows projects VS 2017 is forward and backward compatible with VS 2015, solutions and projects formats are the same.
But not compatible for .NET Core projects, because project.json was changed back to .csproj.
If you create a .csproj in VS 2017 or optimize it as suggested in Old csproj to new csproj: Visual Studio 2017 upgrade guide , it will not be compatible with VS2015 any more.
Related
I downloaded the repository https://github.com/dotnet/runtime and followed this workflow guide https://github.com/dotnet/runtime/blob/master/docs/workflow/README.md
After that, I ran the build.cmd from root directory of the repository. Took me a while to build the project but when I opened any of the Visual Studio solution from one of its libraries (i.e System.Text.Json.sln) I had this error: The project file cannot be opened. Version 5.0.100-rc.2.20479.15 of the .NET Core SDK requires at least version 16.8.0 of MSBuild.
I also downloaded the SDK for .NET 5.0.100-rc.2.20479.15.
Question: How can I have the MSBuild version 16.8.0 on Visual Studio 2019 v16.7.6? Or what am I missing?
Projects built against .NET Core 5.0, preview2 (as the one you have there) require Visual Studio 2019 preview. You can download it from Microsoft, it works with the same license as the official releases.
I had a Visual Studio solution that was working fine. I did a fresh checkout from TFS (with both overwrite checkboxes selected) after deleting the entire source tree. Now C# 7.0 features are not building. Projects that do not build have been confirmed to have Target framework = .NET Framework 4.7.2.
Also, in the Advanced Build Settings, C# 7.0 options are not available (even though 7.0, 7.1, 7.2 and 7.3 are all available on my other machine which has not been wiped clean).
How do I fix this?
Environment: Visual Studio Enterprise 2017 Update 3, ReSharper 2018.1.3 (6/26/2018), C# 4.7.2
The VS2017 solution was mistakenly opened in VS2015 (my dev environment requires both regularly). The solution was obviously to open it in VS2017.
#jonskeet provided the answer in a comment above
I want to switch target for Portable Class Library project from classic profiles to .Net Standard. The problem is that it creates project.json file which is deprecated. If I install any nuget packages, it also leads to updating this file rather than .csproj. I use Visual Studio 2015 and latest version of .NET Core tools for Visual Studio 2015 (Preview2.0.3). Does it mean that I have to switch to VS 2017 or is there a proper way to deal with updated .csproj format and .Net Standard using VS 2015?
If you want to use csproj, you need to use VS 2017.
Even though csproj for VS 2015 is usable, it involves a lot of hacks and isn't really documented or officially supported (and afaik break in VS 2017 without a migration path), so I strongly suggest to stick with project.json or migrate to VS 2017.
I created a WPF project in VS 2013. After upgrading to VS 2015, this error showed in the designer on types derived from the Blend SDK:
the type from assembly is built with an older version of blend sdk and
is not supported in a windows presentation foundation 4 project
Run Command Prompt as Administrator
Change Directory to Blend SDK: cd C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.5\Libraries\
Register DLL: gacutil -i System.Windows.Interactivity.dll
Restart Visual Studio
Reference: https://connect.microsoft.com/VisualStudio/feedback/details/755407/xaml-designer-will-not-display-when-using-blend-sdk-behaviors
You can resolve this issue by manually changing the version numbers in .sln and .csproj files.
In .csproj and .csproj.user
change ToolsVersion to your current Visual Studio version. VS 2013 is version 12, VS 2015 is version 14.
In .sln change VisualStudioVersion to the current version, you can find it in the About window.
Also change Microsoft Visual Studio Solution File, Format Version to your current version (eg 14.00, 12.00)
Note: This only works for built-in assemblies. If external dependencies (like Prism) cause this error, you'd have to recompile them using the new Blend SDK. You could also try to update the dependency, maybe the newest version is already compiled using the latest Blend SDK.
None of the other answers here worked for me. What finally solved it was deleting the .NET v4.0 version of the file in the SDK folder:
C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries\
I am referencing the v4.5 file via NuGet, but it seems that the designer was finding the file in the above folder. The v4.0 file was not registered in the GAC.
The popular answer is valid, but since things are always changing in the developer world, I thought I would note that there's a (IMO) better solution now.
In December 2018, Microsoft released an official, open source, supported NuGet package for XAML behaviors for WPF. (There's a separate one for UWP.) It's very easy to migrate to this package. You need to uninstall your current NuGet package, remove a couple of references, install this package, and change a using statement (or FQN).
https://www.nuget.org/packages/Microsoft.Xaml.Behaviors.Wpf/
https://devblogs.microsoft.com/dotnet/open-sourcing-xaml-behaviors-for-wpf/
I read about it in this SO answer, so credit goes to that OP:
How to add System.Windows.Interactivity to project?
Was having a similar problem using Visual Studio 2017 but none of the answers above fully resolved it for me. Found a Microsoft developer community page that had a workaround that did the trick. Comment by Bran Hagger recommended deleting the .vs folder from the solution's directory. This additional step cleared out the cache and caused Visual Studio to rebuild it.
Just the Microsoft Visual Studio Solution File, Format Version change to 14.00 worked for me.
This also could be that you are mixing different versions of System.Windows.Interactivity.dll, especially if you are getting the SDK from nuget where several different packages provide it, e.g.:
https://www.nuget.org/packages/Expression.Blend.Sdk/
https://www.nuget.org/packages/System.Windows.Interactivity.WPF/
In this case, you'll have to synchronize these libraries among projects.
Deleting the .vs file in the solution folder solved the issue. The issue happened for me after I updated My Visual Studio 2017 and Opened the project that was built before with an older version of Visual studio 2017.
I was going through the latest features introduced in C# 6.0 and just followed an example of auto property initializer,
class NewSample
{
public Guid Id { get; } = Guid.NewGuid();
}
but my IDE did not recognize the syntax.
I am wondering how I could enable C# 6.0 in Visual Studio 2013. The Target framework I am using is 4.5.1.
Under VS2013 you can install the new compilers into the project as a nuget package. That way you don't need VS2015 or an updated build server.
https://www.nuget.org/packages/Microsoft.Net.Compilers/
Install-Package Microsoft.Net.Compilers
The package allows you to use/build C# 6.0 code/syntax. Because VS2013 doesn't natively recognize the new C# 6.0 syntax, it will show errors in the code editor window although it will build fine.
Using Resharper, you'll get squiggly lines on C# 6 features, but the bulb gives you the option to 'Enable C# 6.0 support for this project' (setting saved to .DotSettings).
As mentioned by #stimpy77: for support in MVC Razor views you'll need an extra package (for those that don't read the comments)
Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
If you want full C# 6.0 support, you'll need to install VS2015.
Information for obsoleted prerelease software:
According to this it's just a install and go for Visual Studio 2013:
In fact, installing the C# 6.0 compiler from this release involves little more than installing a Visual Studio 2013 extension, which in turn updates the MSBuild target files.
So just get the files from https://github.com/dotnet/roslyn and you are ready to go.
You do have to know it is an outdated version of the specs implemented there, since they no longer update the package for Visual Studio 2013:
You can also try April's End User Preview, which installs on top of Visual Studio 2013.
(note: this VS 2013 preview is quite out of date, and is no longer updated)
So if you do want to use the latest version, you have to download the Visual Studio 2015.
A lot of the answers here were written prior to Roslyn (the open-source .NET C# and VB compilers) moving to .NET 4.6. So they won't help you if your project targets, say, 4.5.2 as mine did (inherited and can't be changed).
But you can grab a previous version of Roslyn from https://www.nuget.org/packages/Microsoft.Net.Compilers and install that instead of the latest version. I used 1.3.2. (I tried 2.0.1 - which appears to be the last version that runs on .NET 4.5 - but I couldn't get it to compile*.) Run this from the Package Manager console in VS 2013:
PM> Install-Package Microsoft.Net.Compilers -Version 1.3.2
Then restart Visual Studio. I had a couple of problems initially; you need to set the C# version back to default (C#6.0 doesn't appear in the version list but seems to have been made the default), then clean, save, restart VS and recompile.
Interestingly, I didn't have any IntelliSense errors due to the C#6.0 features used in the code (which were the reason for wanting C#6.0 in the first place).
* version 2.0.1 threw error The "Microsoft.CodeAnalysis.BuildTasks.Csc task could not be loaded from the assembly Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
UPDATE One thing I've noticed since posting this answer is that if you change any code during debug ("Edit and Continue"), you'll like find that your C#6.0 code will suddenly show as errors in what seems to revert to a pre-C#6.0 environment. This requires a restart of your debug session. VERY annoying especially for web applications.
It worth mentioning that the build time will be increased for VS 2015 users after:
Install-Package Microsoft.Net.Compilers
Those who are using VS 2015 and have to keep this package in their projects can fix increased build time.
Edit file packages\Microsoft.Net.Compilers.1.2.2\build\Microsoft.Net.Compilers.props and clean it up. The file should look like:
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
Doing so forces a project to be built as it was before adding Microsoft.Net.Compilers package
It is possible to use full C# 6.0 features in Visual Studio 2013 if you have Resharper.
You have to enable Resharper Build and voilá!
In Resharper Options -> Build - enable Resharper Build and in "Use MSBuild.exe version" choose "Latest Installed"
This way Resharper is going to build your C# 6.0 Projects and will also not underline C# 6.0 code as invalid.
I am also using this although I have Visual Studio 2015 because:
Unit Tests in Resharper don't work for me with Visual Studio 2015 for some reason
VS 2015 uses a lot more memory than VS 2013.
I am putting this here, as I was looking for a solution for this problem for some time now and maybe it will help someone else.
It seems there's some misunderstanding. So, instead of trying to patch VS2013 here's and answer from a Microsoft guy: https://social.msdn.microsoft.com/Forums/vstudio/en-US/49ba9a67-d26a-4b21-80ef-caeb081b878e/will-c-60-ever-be-supported-by-vs-2013?forum=roslyn
So, please, read it and install VS2015.