Incorrect addin instruction for VS2008

Announcements and discussion for PInvoke

Moderators: Luke Jefferson, Robert

Incorrect addin instruction for VS2008

Postby aram » Tue Feb 05, 2008 9:40 am

Hello Everyone,
I think there is a mistyped line in the instruction mentioned at
http://www.red-gate.com/support/kb/KB200711000198.htm
Note that visual studio Add-in file is an standard xml-based file which needs to have all tags correctly opened and closed.
Where it says in the instructions:
After the text:(part1)
---------------------------------------------
<HostApplication>
<Name>Microsoft Visual Studio Macros</Name>
<Version>8.0</Version>
</HostApplication>
<HostApplication>
<Name>Microsoft Visual Studio</Name>
<Version>8.0</Version>
</HostApplication>
<HostApplication> this is incorrect.
----------------------------------------------
Add:(part2)
----------------------------------------------
<HostApplication>
<Name>Microsoft Visual Studio Macros</Name>
<Version>9.0</Version>
</HostApplication>
<HostApplication>
<Name>Microsoft Visual Studio</Name>
<Version>9.0</Version>
</HostApplication>
<HostApplication> this is also incorrect.
and save the file.

---------------------------------------

if you add 'part 2' to the end of 'part 1' you will definitely get an error from VS2008 and your addin will never work.
Please if moderators could fix this in the mentioned link.

Thank you again for your products.

Best Regards,
Aram Azhari
aram
 
Posts: 1
Joined: Tue Feb 05, 2008 9:01 am

Postby Brian Donahue » Tue Feb 05, 2008 11:10 am

Hi Aram,

Thanks for pointing that out. Looks like I overshot the copy part of the copy-and-paste. :-)
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby BillyT63 » Thu May 29, 2008 8:23 pm

My PInvokeDotNetAddIn.AddIn file looks as follows:

<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
<HostApplication>
<Name>Microsoft Visual Studio Macros</Name>
<Version>8.0</Version>
</HostApplication>
<HostApplication>
<Name>Microsoft Visual Studio</Name>
<Version>8.0</Version>
</HostApplication>
<HostApplication>
<Name>Microsoft Visual Studio Macros</Name>
<Version>9.0</Version>
</HostApplication>
<HostApplication>
<Name>Microsoft Visual Studio</Name>
<Version>9.0</Version>
</HostApplication>
<Addin>
<FriendlyName>pInvoke.net Add-In</FriendlyName>
<Description>Red Gate pInvoke.net Visual Studio 2005 Add-In. Communicates with www.pinvoke.net</Description>
<Assembly>PInvokeDotNetAddIn2005.dll</Assembly>
<FullClassName>PInvokeDotNetAddIn.Connect</FullClassName>
<LoadBehavior>1</LoadBehavior>
<CommandPreload>1</CommandPreload>
<CommandLineSafe>0</CommandLineSafe>
</Addin>
</Extensibility>

Yet, I receive the following error upon invoking Visual Studio .NET 2008:

PInvoke.Net
There was a problem trying to launch the PInvoke.net Visual Studio add-in:
Object reference not set to an instance of an object.
For more details, please see the event log.

This loads perfectly in Visual Studio .NET 2005 using the same add-in XML file. So, what do I have wrong for loading the add-in in VS .NET 2008????

Best Regards,
Bill Tello
billyt63@gmail.com
BillyT63
 
Posts: 2
Joined: Thu May 29, 2008 8:18 pm

Postby Brian Donahue » Fri May 30, 2008 9:21 am

Hi Billy,

The configuration of the add-in is correct, otherwise the PInvoke add-in would not load. In order to get an error from the add-in like this, it must be loading, so that part is okay. It is just that the add-in itself is having a problem. Is there anything in the system or application event log that includes a stack trace?
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby BillyT63 » Fri May 30, 2008 9:51 pm

Hello Brian:

Yes, there are two application errors regarding Pinvoke.net which are posted within my event manager.

The first is when I try to load Microsoft Visual Studio .NET 2008 application with the PInvoke.net add-in loaded and marked to load upon VS start-up, I get the following error:

There was an exception trying to launch the PInvoke.net Visual Studio add-in:
Object reference not set to an instance of an object.

at Microsoft.PowerCommands.Commands.ShowAllFilesCommand.CanExecute(OleMenuCommand command)
at Microsoft.PowerCommands.Commands.DynamicCommand.OnBeforeQueryStatus(Object sender, EventArgs e)
at Microsoft.VisualStudio.Shell.OleMenuCommand.get_OleStatus()
at Microsoft.VisualStudio.Shell.OleMenuCommandService.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.QueryStatus(Guid& guidGroup, UInt32 nCmdId, OLECMD[] oleCmd, IntPtr oleText)
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.QueryStatus(Guid& guidGroup, UInt32 nCmdId, OLECMD[] oleCmd, IntPtr oleText)
at EnvDTE.Commands.AddCommandBar(String Name, vsCommandBarType Type, Object CommandBarParent, Int32 Position)
at PInvokeDotNetAddIn.Connect.OnConnection(Object application, ext_ConnectMode connectMode, Object addInInst, Array& custom)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

The second error occurs when I go into the Microsoft Visual Studio .NET 2008 application without the add-in loaded and marked to start-up automatically. In this scenario, I then go into the add-in manager and mark the add-in to load and start-up automatically and I receive the following error:

There was an exception trying to launch the PInvoke.net Visual Studio add-in:
Error HRESULT E_FAIL has been returned from a call to a COM component.

at EnvDTE.Commands.AddCommandBar(String Name, vsCommandBarType Type, Object CommandBarParent, Int32 Position)
at PInvokeDotNetAddIn.Connect.OnConnection(Object application, ext_ConnectMode connectMode, Object addInInst, Array& custom)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


I appreciate your help with this problem.

Best Regards,
Bill Tello
billyt63@gmail.com
BillyT63
 
Posts: 2
Joined: Thu May 29, 2008 8:18 pm

Postby Brian Donahue » Mon Jun 02, 2008 6:58 pm

Hi Billy,

It would be a piece of cake if we knew which COM component was at fault. Sometimes an error message of this type will mention the CLSID of the offending component. If I had to hazard a guess, though, I'd have a go at the DTE components. From a command prompt, can you try this:
Code: Select all
cd %commonprogramfiles%\\microsoft shared\\MSEnv
regsvr32 dte80.olb
regsvr32 dte.olb
regsvr32 dte80a.olb
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to PInvoke.Net

Who is online

Users browsing this forum: No registered users and 0 guests