I recently upgraded all projects in a solution to .NET 4.7 and started seeing some NuGet warnings:
Essentially what seems to happen is that the NuGet package was installed when .NET 4.6 was the runtime target and this package may or may not need to be reinstalled (everything was functioning, but I just don’t like warnings when compiling).
Turns out there is no UI button for reinstalling a package, so the Package Manager Console is the place to go. The following command will reinstall the appropriate package for all project that use the package:
Update-Package -Id <package_name> –reinstall
Note that as soon as you’ve typed -Id you can use <Tab> to get a drop down list of installed packages.
For more variations of the command see: https://docs.microsoft.com/en-us/nuget/consume-packages/reinstalling-and-updating-packages
I used to have active work item tracking turned on in my Solution Explorer, but that can get annoying, so I turned it off, but then I found I spend too much time searching for my active document. I figured there must be an easier way. Sure enough, Visual Studio has got me covered on this…
So, active item tracking is set in the configuration settings:
As you see, I have turned it off.
Now when you have an active document open in the editor, the Solution Explorer will start a bi-directional arrow icon:
Press it to have the solution explorer track down the active document in the solution explorer. The feature is called ‘Sync with Active Document’. Also accesible via keyboard shortcut: CTRL+[, S
In the last 2 weeks I’ve upgraded two (large) C# / ASP.NET solutions from Visual Studio 2015 to Visual Studio 2017. Good news? By and large things ‘just’ work. But there were three things that required attention:
- Issue: My project used PowerShell projects from “PowerShell Tools for Visual Studio 2015“. This VS2015 extension did not automatically get activated for VS2017.
- Download and reinstall the extension. The installer recognized that VS2017 was now installed and enabled the extension for VS2017.
- Issue: The projects were both using the Microsoft Unit Test framework and the unit test runner would run without issue in VS2017, but Live Unit Testing would not work.
- In the Unit Test project(s) remove the reference to: Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
- Use nuget to add MSTest.TestAdapter and MS.TestFramework to the unit test project:
- Issue: My Team Services CI build failed after I started using C#7 syntax in my code.
Solution: Install Visual Studio 2017 on the build server and change the build definition to use Visual Studio 2017 for building the solutions.
Alas, this will not (yet) work if you’re using a Hosted Agent. So be sure to be using a build agent that runs on a machine where Visual Studio 2017 is installed.
Useful to know:
- For a short time some team members were working with VS2015 and some with VS2017. No problem as long as you’re not using C#7 syntax just yet 🙂
- Play around with including/excluding tests from Live Unit Testing, for larger solutions the performance hit of having all the tests being run all the time seems prohibitive.