你是否缺少using指令或程序集引用?是还是不是?

3

我已经多次清理并重建了所有内容,重新启动了VS和计算机,但没有进展。在修复QueryCommander开源项目中的一些错误时,我遇到了这样一个问题,在Debug构建下可以正常工作,但是Release模式下就无法工作。我只有在Release模式下才会收到以下错误信息:

CS0246  The type or namespace name 'AxSHDocVw' could not be found (are you missing a using directive or an assembly reference?)
QueryCommander.Help C:\Workspace\QueryCommander_4_0_0_0\QueryCommander.Help\WinGui\FrmHelpBrowser.cs

参考资料确实存在: enter image description here 并且它确实包含了缺失的命名空间: enter image description here 单位确实没有using指令,但我不确定为什么在Debug模式下可以工作,并且这里应该使用什么。
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using QueryCommander.Help.WinGui.Base;

namespace QueryCommander.Help.WinGui
{
    /// <summary>
    /// Summary description for FrmHelpBrowser.
    /// </summary>
    public class FrmHelpBrowser : FrmBaseContent
    {
        public AxSHDocVw.AxWebBrowser axWebBrowser1; // Error on this line
//----------------^ here

发布模式中缺少什么?


1
参考是否已经根据构建配置进行了条件设置?卸载项目,然后在XML编辑器中打开它并找到引用 - 它或其附近是否具有“Condition”属性? - Damien_The_Unbeliever
1个回答

4

啊!原始项目中的参考引用是指位于bin\Debug下的DLL(查看参考属性窗口)。我删除了该引用,并使用解决方案根目录中的AxInterop.SHDocVw.dll添加了它——问题得到解决!


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接