CompilationOptions ctor error when using Microsoft.CodeAnalysis - MissingMethodException
Latest VS 2015 Community (downloaded this morning) and Linqpad (downloaded a couple of days ago) gives errors in the CompilationOptions constructors in "C# 6.0 in a Nutshell - Chapter 27" compilation samples. Seems like they should work. It looks like the constructor takes an OutputKind and then a bunch of defaulted values but "new CSharpCompilationOptions (OutputKind.ConsoleApplication)" seems to give an error using the samples out of the box.
Comments
You can verify this as follows: The difficulty arises if you've got 1.1.37.0 installed in the GAC. Despite NuGet wanting to use the later version, the GAC reference loads automatically and takes precedence, and you get the MissingMethodException.
Go to Query | App.Config (Ctrl+Shift+O). Click 'Let me type it in' and paste the following in: To avoid having to do this for every query that uses Roslyn assemblies, click the 'Save as snippet' button and choose a short name such as 'roslyn'. Then with any query, you'll just have to type roslyn followed by the tab key, and you'll get the roslyn assemblies, the namespace imports and the app.config settings added to your query in one hit.
In terms of a permanent solution, I'm not sure on how (and whether) to proceed - I guess it depends on whether this is a one-off or a recurring problem.
https://www.linqpad.net/Download.aspx#beta
It now identifies the problem scenario and creates binding redirects on the fly.