Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"are you missing a using directive or assembly reference?" Am I or am I not?

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

The reference does actually exists:

enter image description here

And it does contain the missing namespace:

enter image description 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

What is missing in the release mode?

like image 279
ajeh Avatar asked Jan 24 '26 14:01

ajeh


1 Answers

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!

like image 66
ajeh Avatar answered Jan 26 '26 04:01

ajeh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!