问题描述
多次清理并重建所有内容,重新启动VS和计算机,但没有任何进展。修补QueryCommander开源项目中的一些错误时,我遇到了一个问题,其中有Debug构建,而Release没有。我仅在发布模式下收到此错误:
Cleaned and rebuilt everything many times, restarted VS and computer but no progress. Patching some bugs in the QueryCommander open source project, I came across an issue where Debug builds, but Release does not. I get this error in Release mode only:
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
引用确实存在:
它确实包含缺少的命名空间:
And it does contain the missing namespace:
单元 FrmHelpBrowser.cs
没有使用
指令确实可以,但是我不确定为什么它可以在 Debug
模式下工作,应该使用什么d here:
The unit FrmHelpBrowser.cs
does not have a using
directive indeed, but I am not sure why that works in Debug
mode and what should be used here:
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
发布模式中缺少什么?
推荐答案
啊!原始项目中的引用是位于 bin\Debug
下的DLL(在参考属性窗口中查看)。我删除了引用,并使用解决方案的根目录中的 AxInterop.SHDocVw.dll
将其添加了-问题已解决!
Argh! The reference in the original project was to the DLL sitting under bin\Debug
(looking at the reference properties window). I deleted the reference and added it using the AxInterop.SHDocVw.dll
in the solution's root directory - problem solved!
这篇关于“您是否缺少using指令或程序集引用?”是我还是不是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!