开发者

UseHostCompilerIfAvailable False causes an "One or more types required to compile a dynamic expression cannot be found" error

开发者 https://www.devze.com 2023-01-16 22:19 出处:网络
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 refu

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号