Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / August 2006

Tip: Looking for answers? Try searching our database.

Problem move my Add-in from VS 2003 to VS 2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Haiping - 09 Aug 2006 20:13 GMT
Hello,

I have a Add-in it was built in VS 2003. Now I am moving it to VS 2005.  It
is written in C#. I use the the following article to guild me to move it to
VS 2005.

http://msdn2.microsoft.com/en-us/library/ms165634.aspx

I got the the following error message when I click it from Add-in Manager:

The Add-in "MyAddin" failed to load or caused an exception.

Error Message: Unspecified error.

Error number: 80004005

Does any body knows what couse this problem?

Thanks for any help,

Haiping
Carlos J. Quintero [VB MVP] - 10 Aug 2006 08:51 GMT
Hi,

I answered in the MSDN Forum:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=621318&SiteID=1
Signature


Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com

> Hello,
>
[quoted text clipped - 17 lines]
>
> Haiping
Gary Chang[MSFT] - 10 Aug 2006 09:53 GMT
Hi Haiping,

That MSDN article just provides the general direction on how to upgrade an
VS2003 managed Addin to VS2005, and you also need to ensure your upgraded
addin's code compatible to VS2005.

The "Unspecified error" is just a general error message, it doesn't give us
any particular info about what problem caused your Addin loading failed.

I suggest you run that addin in the debug mode and check the Output window
while your Addin fails to be loaded, it will give you some more detailed
info, such as "A first chance exception of type ..."

I appreciate your time in performing them. Let me know the results at your
earliest convenience. If you have any questions or concerns, please let me
know. I am standing by to help you.

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Haiping - 10 Aug 2006 16:45 GMT
The following line cause problem. If I take this line out I don't get
80004005 error but the context menu item is grayed out; if I put this line
back the context menu item will be enabled for a while. By default the
commandBar Enabled is set to ture; Visible is set to false. I also checked VS
2003 it has similar seting for these two properties Enabled is set to ture;
Visible is set to false.

commandBar.Visible = true;

Here are the code snippt from OnConnection();

public void OnConnection(object theApplication,
Extensibility.ext_ConnectMode theConnectMode, object theAddInInstance, ref
System.Array theCustom)
{

myApplicationObject = (DTE2)theApplication;
myAddInInstance = (AddIn)theAddInInstance;
object[] contextGuides = new object[] { };
Commands commands = myApplicationObject.Commands;
Microsoft.VisualStudio.CommandBars._CommandBars commandBars =
(Microsoft.VisualStudio.CommandBars._CommandBars)(myApplicationObject.CommandBars);
CommandBar commandBar = (CommandBar)commandBars["Code Window"];

//commandBar.Visible = true; // This line cause the Add-in failed to load.
If don't add this line the context  menu item will be grayed out.

try
{
if (myDebuggerEvents == null)
{
myDebuggerEvents = myApplicationObject.Events.DebuggerEvents;
}
myApplicationObject.Events.DebuggerEvents.OnEnterBreakMode += new
_dispDebuggerEvents_OnEnterBreakModeEventHandler(OnEnterBreakMode);

// Adds the command to the right click context menu.
Command command = commands.AddNamedCommand(myAddInInstance,
"VisualDebuggerNodeVS2005",
"VisualDebuggerVS2005",
"VisualDebuggerVS2005",
true,
1,
ref contextGuides,
(int)vsCommandStatus.vsCommandStatusSupported +
(int)vsCommandStatus.vsCommandStatusEnabled);
Microsoft.VisualStudio.CommandBars.CommandBarControl commandBarControl =
(Microsoft.VisualStudio.CommandBars.CommandBarControl)(command.AddControl(commandBar, 1));
}
catch (Exception)
{
}
}

Here are the message from Out Put window. The last line coused by this
commandBar.Visible = true.

'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.CommonIDE\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.CommonIDE.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio\2.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Shell\2.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Shell.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.Shell.Interop\7.1.40304.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Shell.Interop.dll', No symbols loaded.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.OLE.Interop\7.1.40304.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.OLE.Interop.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.Shell.Interop.8.0\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Shell.Interop.8.0.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.Designer.Interfaces\1.0.5000.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Designer.Interfaces.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing.Design\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.Design.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Engine\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Engine.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Framework\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Framework.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\CustomMarshalers\2.0.0.0__b03f5f7f11d50a3a\CustomMarshalers.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Design\2.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Design.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Shell.Design\2.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Shell.Design.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC\EnvDTE\8.0.0.0__b03f5f7f11d50a3a\EnvDTE.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Tasks\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Tasks.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Utilities\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Utilities.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'devenv.exe' (Managed): Loaded
'K:\hjia_algorithms_miscellaneous_scr97\ALGORITHMS\Miscellaneous\VisualDebugger\Development\bin\Debug\BeckmanCoulter.Algorithms.VisualDebugger.dll',
Symbols loaded.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC\Extensibility\7.0.3300.0__b03f5f7f11d50a3a\Extensibility.dll', No symbols loaded.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.CommandBars\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.CommandBars.dll', No symbols loaded.
'devenv.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC\EnvDTE80\8.0.0.0__b03f5f7f11d50a3a\EnvDTE80.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
A first chance exception of type
'System.Runtime.InteropServices.COMException' occurred in
BeckmanCoulter.Algorithms.VisualDebugger.dll
Dustin Campbell - 10 Aug 2006 17:32 GMT
It seems very unorthodox to me to set the visibility of a context menu within
the OnConnection handler of your add-in. What exactly are you trying to achieve?
Also, because the "CodeWindow" command bar is actually a context menu and
not a toolbar, you should probably use the CommandBar.ShowPopup() method.

Best Regards,
Dustin Campbell
Developer Express Inc.
Haiping - 10 Aug 2006 18:36 GMT
Hi Gary,

My Add-in is a visual debugger it works like this:
When debug the project hight an object , usually  a histogram or an array,
and click the context menu item of my Add-in; the object will be shown on the
2D charts.

Carlos sugested me to change IDTCommandTarget.QueryStatus method not set
commandBar.Visible = true on hte OnConnect. It works fine now.

Thank you,
Haiping
Dustin Campbell - 10 Aug 2006 18:44 GMT
> Carlos sugested me to change IDTCommandTarget.QueryStatus method not
> set commandBar.Visible = true on hte OnConnect. It works fine now.

Ah ha. Yes, that would work as well.

Best Regards,
Dustin Campbell
Developer Express Inc.
Gary Chang[MSFT] - 11 Aug 2006 03:29 GMT
That's great, Haiping!

I am glad to know you have already found the resolution by the community
members' help. :)

Hav a nice day!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Haiping - 11 Aug 2006 16:07 GMT
Hi Gary,

Yes. I am so glad that I found a good community. I should post my question
here earlier.

Thanks for your help.
We just create a installation package. It works nicely in our developer's
computer.

Haipoing

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.