本文介绍了缺少VB.net 2010 Ultimate错误comctl32.dll作为参考.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在向vb.net 2010进行VB6转换的过程中使用VB IDE了好几个月了.在出现调试消息之前,我一直没有遇到任何麻烦,直到出现以下消息为止.现在,这使我无法在调试中运行.我尚未在 生成菜单或使用的ClickOnce.

I have been using the VB IDE for many months on a VB6 translation to vb.net 2010. I have had no troubles building and running in debug,until the message below just appeared. This now prevents me from running in debug. I have not used Publish  in the Build menu or used ClickOnce. 

项目-应用程序"页面具有启用XP视觉样式",已选中.我不希望取消选中此复选框,这样会删除以下错误消息.

The Project - application page has "enable XP visual styles" checked. I do not want this unchecked, which will remove the error message below.

错误消息是:

 

错误2找不到文件'Microsoft.Windows.Common-Controls,Version = 6.0.0.0,Culture = *,PublicKeyToken = 6595b64144ccf1df,ProcessorArchitecture = *,Type = win32'.

Error 2 Could not find file 'Microsoft.Windows.Common-Controls, Version=6.0.0.0, Culture=*, PublicKeyToken=6595b64144ccf1df, ProcessorArchitecture=*, Type=win32'.

这是指文件comctl32.dll,该文件的副本现在位于项目目录中.我无法使用浏览在引用"页面中为其添加引用,消息为:

This refers to file comctl32.dll, a copy of which is now in the project directory. I have been unable to add a reference to it in the References page, using browse, the message being:

"无法添加对comctl32.dll的引用.请确保它是有效的程序集或com组件".

"A reference to comctl32.dll could not be added. Please make sure that it is a valid assembly or com component"

错误列表指出找不到文件'Microsoft.Windows.CommonControls,版本6.0.0.0,Culture = *,PublicKeyToken = 6595b64144ccf1df,ProcessorArchitecture = *,Type = win32".

The error list states "Could not find file 'Microsoft.Windows.CommonControls, Version 6.0.0.0, Culture= *, PublicKeyToken=6595b64144ccf1df, ProcessorArchitecture=*, Type=win32'.

此版本和PublicKeyToken等来自app.manifest  " assemblyIdentity"

This version and PublicKeyToken etc comes from the app.manifest  "<assemblyIdentity"

我正在Windows 7 64位环境下运行.我改变了 从任何CPU到x86的编译/高级编译器设置,均无效.平台保持活动状态(任何CPU),不可更改.

I am running under Windows 7 64 bit. I have changed the compile/advanced Compiler settings from anyCPU to x86, without effect. Platform remains at active(any CPU), unchangeable.

包含App.manifest.


<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity version="5.0.0.0" name="AffinityN" />
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <!-- UAC Manifest Options
            If you want to change the Windows User Account Control level replace the 
            requestedExecutionLevel node with one of the following.

        <!requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <!requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <!requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

            Specifying requestedExecutionLevel node will disable file and registry virtualization.
            If you want to utilize File and Registry Virtualization for backward 
            compatibility then delete the requestedExecutionLevel node.
        -->
        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
      </requestedPrivileges>
      <applicationRequestMinimum>
        <PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
        <defaultAssemblyRequest permissionSetReference="Custom" />
      </applicationRequestMinimum>
    </security>
  </trustInfo>
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!-- A list of all Windows versions that this application is designed to work with. Windows will automatically select the most compatible environment.-->
      <!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />--&gt;
    </application>
  </compatibility>
  <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
  <dependency>
    <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> 
  </dependentAssembly>
   </dependency>--&gt;

</asmv1:assembly>

推荐答案

该文件不是COM DLL,因此不应移动. COM包装器组件是Comctl32.ocx(在同一位置找到).我怀疑这是应用程序应引用的组件(添加引用... COM选项卡... Microsoft Windows Common 控件6.0).

This file is not a COM DLL and should not be moved, however; the COM wrapper component is Comctl32.ocx (which is found in the same location). I would suspect this is component the app should be referencing (Add Reference...COM tab...Microsoft Windows Common Controls 6.0).

此外,请记住,没有64位版本的COM包装器,因此,如果您的应用程序正在运行64位,则不能使用此组件.如果找不到Comctl32.ocx,则必须将其复制到相应的System文件夹并使用 Regsvr32实用程序.

Also, keep in mind that there is no 64-bit version of the COM wrapper, so you cannot use this component if your app is running 64-bit. If you cannot find Comctl32.ocx then it will have to be copied to the appropriate System folder and registered using the Regsvr32 utility.


这篇关于缺少VB.net 2010 Ultimate错误comctl32.dll作为参考.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 00:44