2011-06-23 50 views

回答

10

尝试在ConfigurationElementType之后添加关键字属性。这不是必需的,但这可能会让你得到一个更有用的错误信息......我的猜测是你缺少引用......这总是EntLib的问题。

+1

哇,非常感谢。这确实解决了这个问题。奇怪的是,所有的资源(包括msdn)如何使用ConfigurationElementType而不是ConfigurationElementTypeAttribute。 –

5

一定要在项目添加引用.Net选项卡下将对System.ComponentModel.Compostion或Sytem.ComponentModel.DataAnnotations的引用添加到您的项目。

然后你应该可以包含'using System.ComponentModel;'在你的项目中让你的属性正常工作。

+1

将System.ComponentModel.Compostion添加到为我工作的引用。 –

+0

添加system.Web.mvc为我工作 –

0

将Enterprise Library Shared Library程序集添加到为我工作的项目的引用中。然后,你可以添加使用Microsoft.Practices.EnterpriseLibrary.Common.Configuration;