I have some code that was taken out of mothballs and handed to me. It was built in Visual Studio 2015, and that's what I'm using to build it. The original developer can't be reached, but I'm told it always built before. I have two tests that just won't build. The offending lines look like this:
PathUtilities.DragDropWidgetToView(mainWindow, screen, true, out bool unused, out bool unused2);
Those last two parameters are the funky ones. unused
and unused2
aren't defined anywhere else. While that's valid syntax for the current versions of .NET, the IDE is complaining about them.
These are the errors it throws:
CS1525 Invalid expression 'bool'
CS1003 Syntax error, ',' expected
CS1525 Invalid expression 'bool'
CS1003 Syntax error, ',' expected
CS0103 The name 'unused' does not exist in the current context
CS0103 The name 'unused2' does not exist in the current context
The usings are:
using System.Collections.Generic;
using System.Threading;
using System.Windows.Automation;
using UIAutomation.ScreenUtilities;
using UIAutomation.ScreenUtilities.Screens;
And none of them are broken. All the references are intact as well.
I've commented out the tests to get it to build, but that really isn't permitted for production code.
Clearly I need to upgrade the version of .NET that Visual Studio is using. The original developer's instructions say that VS2017 can be used, but only if the C# 7 features are disabled. I'd prefer to not have to upgrade to VS2017 since our PCs are locked-down and we aren't permitted to install anything ourselves.