多次清理和重建所有内容,重新启动 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
引用确实存在:
它确实包含缺少的命名空间:
单元 FrmHelpBrowser.cs
确实没有 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
Release模式缺少什么?
最佳答案
啊!原始项目中的引用是位于 bin\Debug
下的 DLL(查看引用属性窗口)。我删除了引用并使用解决方案根目录中的 AxInterop.SHDocVw.dll
添加了它 - 问题已解决!
关于c# - "are you missing a using directive or assembly reference?"我是还是不是?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44460026/