Warning messages won't go away, and now won

2019-08-14 12:50发布

I have had these two errors since I have started my project:

"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."

and

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."

Then just a second ago, I started getting this error and now I cant publish the program.

"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."

I'm not using power pack or mscomctl, the only things I am importing are:

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

This is killing me, Ive checked my recent references and there is nothing in there, and I check my program properties>references and there is nothing referring to power pack or mscomctl.

1条回答
叼着烟拽天下
2楼-- · 2019-08-14 13:37

The reference to Microsoft.Office.Interop.Excel is creating the first two warnings. Here is a link to the Microsoft KB article that describes the issue:

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

You should be able to remove the error with the following steps:

1) Open your references in Visual Studio

2) Select Microsoft.Office.Interop.Excel

3) Press F4 to display the properties page for the reference (or select Properties Window from the View menu)

4) Change the Embed Interop Types value in the properties sheet to False.

I would check your references again if the PowerPacks reference just started showing up because you may have accidentally dragged a control from PowerPacks onto one of your forms.

If it still isn't visible, try closing your project, then opening the .vbproj file in Notepad or Wordpad and manually remove the reference to PowerPacks then reopen the solution.

查看更多
登录 后发表回答