如何检查 Delphi Prism 项目是否是网站?
我想检查一个项目是否是一个网站。
我使用 Project
类和 Property
属性来完成此操作,方法是检查 CurrentWebsiteLanguage
是否具有值,或者是否为 null
。但是,这不适用于 Delphi Prism 网站。
因此,我尝试检查 AspnetVersion
属性,但它引发了异常。
“System.Reflection.TargetInitationException”。预定义类型“Microsoft.CSharp.RuntimeBinder.Binder”未定义或导入
I want to check if a project is a website.
I did it with the Project
class, with the Property
property, by checking if CurrentWebsiteLanguage
has value, or is null
. However, that doesn't work for Delphi Prism websites.
So, I tried by checking the AspnetVersion
property, but it throws an exception.
'System.Reflection.TargetInvocationException'. Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谷歌搜索该错误时发现,人们在使用
dynamic
关键字时没有引用他们需要引用的所有程序集。在项目中添加对
Microsoft.CSharp.dll
和System 的引用.Core.dll
并且该特定错误应该消失。A google search for that error is bringing up cases where people didn't reference all the assemblies they needed to reference while using the
dynamic
keyword.Add references in your project to
Microsoft.CSharp.dll
andSystem.Core.dll
and that particular error should go away.