UseHostCompilerIfAvailable False causes an "One or more types required to compile a dynamic expression cannot be found" error
The C# dynamic
type seems not to compile when UseHostCompilerIfAvailable
is s开发者_JAVA技巧et to false
. I have both the required references Microsoft.CSharp
and System.Core
in my project, but it refuses to recognize it. Using the integrated Visual Studio compiler works, however.
The offending line is:
dynamic obj = this.Engine.Operations.CreateInstance(pytype);
Never mind, it seemed that including the Microsoft.Scripting.Core
assembly was the cause of this.
精彩评论