After upgrading the dependencies in project roslyn compiler started to throw missing method exception in the following code that before update worked:
CSharpCompilation compilation = CreateCompilation(templateId, syntaxTrees, metadataReferences);
EmitResult compileResult;
generatedAssembly = string.Empty;
using (var stream = new MemoryStream())
{
compileResult = compilation.Emit(stream);
Now its throwing MissingMethod exception:
System.MissingMethodException
Method not found: 'System.Collections.Immutable.ImmutableArray`1<Microsoft.CodeAnalysis.Diagnostic> Microsoft.CodeAnalysis.Emit.EmitResult.get_Diagnostics()'.
All the dependencies are updated to current latest versions:
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.Common" version="1.3.2" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.CSharp" version="1.3.2" targetFramework="net461" />
<package id="System.Collections.Immutable" version="1.2.0" targetFramework="net461" />
fds