vs2010/c# 中表命名空间错误
我在项目中添加了一个表,其内容如下:
Table table1 = new Table();
table1.RowGroups.Add(new TableRowGroup());
table1.RowGroups[1].Rows.Add(new TableRow());
TableRow currentRow = table1.RowGroups[1].Rows[1];
当我添加表时,为了引用它,我添加了一个引用presentationFramework.dll以开始使用命名空间“System.Windows.Documents”。然后它开始给我3个错误
类型“System.Windows.Markup.IAddChild”是在未引用的程序集中定义的。您必须添加对程序集“PresentationCore,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”的引用。
类型“System.Windows.IInputElement”是在未引用的程序集中定义的。您必须添加对程序集“PresentationCore,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”的引用。
类型“System.Windows.ContentElement”是在未引用的程序集中定义的。您必须添加对程序集“PresentationCore,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”的引用
我不明白这一点。我应该怎么做才能纠正这个错误?
请帮我
I added a table in my project which is along these lines:
Table table1 = new Table();
table1.RowGroups.Add(new TableRowGroup());
table1.RowGroups[1].Rows.Add(new TableRow());
TableRow currentRow = table1.RowGroups[1].Rows[1];
When I added the table, to reference it, i added a reference presentationFramework.dll to start using the namespace "System.Windows.Documents". Then it started giving me 3 errors
The type 'System.Windows.Markup.IAddChild' is defined in an assembly that is not referenced. You must add a reference to assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
The type 'System.Windows.IInputElement' is defined in an assembly that is not referenced. You must add a reference to assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
The type 'System.Windows.ContentElement' is defined in an assembly that is not referenced. You must add a reference to assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
I don't understand this. What should I do to correct this error?
Please help me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加对PresentationCore DLL 的引用,该引用也在GAC 中并且是必需的。
布莱恩
Add a reference to PresentationCore DLL, which is also in the GAC and is required.
Brian