警告信息不会消失,现在不会让我发布

时间:2011-10-27 22:08:32

标签: vb.net visual-studio visual-studio-2010

自从我启动项目以来,我遇到了这两个错误:

"A reference was created to embedded interop assembly 'stdole' because of an indirect reference to that assembly from assembly 'AxInterop.MSComctlLib'. Consider changing the 'Embed Interop Types' property on either assembly."

A reference was created to embedded interop assembly 'stdole' because of an indirect reference to that assembly from assembly 'mscomctl'. Consider changing the 'Embed Interop Types' property on either assembly."

然后就在一秒钟前,我开始收到此错误,现在我无法发布该程序。

"The referenced assembly "Microsoft.VisualBasic.PowerPacks, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project."

我没有使用power pack或mscomctl,我导入的唯一内容是:

System.Windows.Forms.DataVisualization.Charting, System.IO, System.Text.RegularExpressions, Microsoft.Office.Interop.Excel

这是杀了我,我检查了我最近的参考资料,那里没有任何内容,我检查了我的程序属性>参考资料,没有任何内容涉及power pack或mscomctl。

1 个答案:

答案 0 :(得分:6)

对Microsoft.Office.Interop.Excel的引用正在创建前两个警告。以下是Microsoft KB文章的链接,该文章描述了该问题:

http://msdn.microsoft.com/en-us/library/ff182188.aspx

您应该可以使用以下步骤删除错误:

1)在Visual Studio中打开引用

2)选择Microsoft.Office.Interop.Excel

3)按F4显示参考的属性页面(或从“视图”菜单中选择“属性窗口”)

4)将属性表中的Embed Interop Types值更改为False。

如果PowerPacks参考刚刚开始显示,我会再次检查你的引用,因为你可能不小心将一个控件从PowerPacks拖到你的一个表单上。

如果仍然不可见,请尝试关闭项目,然后在记事本或写字板中打开.vbproj文件,并手动删除对PowerPacks的引用,然后重新打开解决方案。

相关问题