加载已经编好的VB程序时出现不能加载mscomct2.ocx,如果继续加载运行就出现错误,怎么办呢?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了加载已经编好的VB程序时出现不能加载mscomct2.ocx,如果继续加载运行就出现错误,怎么办呢?相关的知识,希望对你有一定的参考价值。

MSCOMCT2.OCX控件未在系统注册。可在开始-运行栏输入:"regsvr32 路径\mscomct2.ocx"
进行注册,路径为你mscomct2.ocx的位置。
不过为下次运行成功,最后是将该控件放入系统文件夹中,如WINDOW/SYSTEM32目录下,再按上面的方法注册
参考技术A 哥们,这是我找到的唯一一个靠谱的方案啦,希望对你有所帮助(此方案由junglerover提供)

新建一个VB工程,然后按CTRL+T,选中
“Microsoft Windows Common Controls 6.0”
然后确定。再保存该工程。此后,用记事本打开
新的这个VBP文件,找到有关MSCOMCTL.OCX的那行,
COPY到你原来的VBP里就可以了。

我自己试过,真不错!
参考技术B 找到这个文件,把它拷到exe文件同一个目录下,兴许你的系统里就有,搜索下,不行上网找下本回答被提问者采纳

System.Windows.Interactivity - 加载程序集时出现异常

【中文标题】System.Windows.Interactivity - 加载程序集时出现异常【英文标题】:System.Windows.Interactivity - exception while loading assembly 【发布时间】:2013-12-09 18:31:21 【问题描述】:

在我的 WPF 应用程序中添加了一些对 View 的新引用后,我遇到了一个异常:

"Could not load file or assembly 'System.Windows.Interactivity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

堆栈跟踪:

at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at MyApplication.GUI.MyPage.InitializeComponent() in c:\Users\Dl\Documents\Visual Studio 2012\Projects\MyApplication\MyApplication.GUI\MyPage.xaml:line 1
at MyApplication.GUI.MyPage..ctor(SettingsViewModel settingsViewModel) in c:\Users\Dl\Documents\Visual Studio 2012\Projects\MyApplication\MyApplication.GUI\MyPage.xaml.cs:line 13 

这是导致异常的代码:

<i:Interaction.Triggers>
    <si:DataEventTrigger EventName="MyEvent">
        <ei:ControlStoryboardAction Storyboard="StaticResource MyStoryboard" 
               ControlStoryboardOption="Play"/>
    </si:DataEventTrigger>
</i:Interaction.Triggers>

我添加的参考文献:

Microsoft.Expression.Interactions (ver. 4.5)
System.Windows.Interactivity (ver. 4.5)
Expression.Samples.Interactivity (ver. 1.0.0.0)

我不知道 System.Windows.Interactivity 3.5 依赖项来自何处。你能给我一个线索吗?

顺便说一句:This 可以澄清我的意图。

【问题讨论】:

System.Windows.Interactivity 是 Blend 附带的一个 dll。您可能需要将 dll 复制到解决方案中。 【参考方案1】:

解决方案是引用 blend 提供的程序集,而不是 .NET Framework 4.5 中的程序集。

感谢 Magus 的帮助。你让我上了正确的卡车。

【讨论】:

Expression.Samples 引用旧版本的可能性更大。

以上是关于加载已经编好的VB程序时出现不能加载mscomct2.ocx,如果继续加载运行就出现错误,怎么办呢?的主要内容,如果未能解决你的问题,请参考以下文章

使用应用程序加载器在 App Store 中上传 ipa 时出现问题

C#程序在VS编译器加载时出现找不到方法,无法显示该程序窗体设计器

加载程序集 Xamarin.Android.Support.v4 时出现异常

提前编译时出现 SystemJS 错误(NgZone 没有提供程序)

解决配置hive时出现不能加载自己修改的hive-site.xml等配置文件的问题。

VC++程序调试时出现“ 下面的框架可能不正确和/或缺失,没有为 kernel32.dll 加载符号”怎么回事?