Hello,
I am making my VSI installer, and it is working mostly ok. But I have a couple minor issues. First, let me explain that I have many <Content> Sections in the VSContent file. There are 2 ProjectTempaltes, 2 ItemTemplates, and My Addin.
The 4 Templates all get installed to their proper place, and load up just fine.
The addin gets installed to the right place as well, but i have The Partner Assembly in the GAC. When I had the dll in the addin folder to debug, it was easy and all worked well. The <Assembly> element was simply GBMVSEnviromet.dll. Now, when it's in the GAC, I thoguht I would do the same thing as in the Template for Wizards. Using the Assembly, version, culture, pky, custom, below i pasted both my XMLS. However, now that the assembly is in the GAC, and i reference it from there, VS throws me an error and does not allow me to install my addin offering to kindly rename it to addin_ :-)
MyAddin.AddIn
<Addin>
<FriendlyName>GBMVSEnviroment</FriendlyName>
<Description>GBMVSEnviroment - Adds GBM Specific functionality to your VSIP</Description>
<Assembly>GBM.EnviromentDTE, Version=1.10.10.14, Culture=neutral, PublicKeyToken=xxxxxxxxxxx, Custom=null</Assembly>
<FullClassName>GBMVSEnviroment.Addins.Connect</FullClassName>
<LoadBehavior>1</LoadBehavior>
<CommandPreload>1</CommandPreload>
<CommandLineSafe>0</CommandLineSafe>
</Addin>
<Content> for addin in vsContent
<Content>
<FileName>GBMVSEnviroment.AddIn</FileName>
<DisplayName>GBM Visual Studio Addins</DisplayName>
<Description>GBM IDE extensions.</Description>
<FileContentType>Addin</FileContentType>
<ContentVersion>1.0</ContentVersion>
</Content>

VSContent and Addin Schema Question / Issue
Deicide
Hi Jonathan,
I just checked, and removing processorArchitecture from my .addin file causes my GAC'ed addin not to load, so it seems like that might be the problem. The logic for loading addins is different from that used by the project templates, so it seems that it's required for loading addins.
My Addin section looks like this:
<
Addin><FriendlyName>MyAddin1 - No Name provided.</FriendlyName>
<Description>MyAddin1 - No Description provided.</Description>
<Assembly>MyAddin1, Version=1.0.2369.13914, Culture=neutral, PublicKeyToken=f3e01808e8ed2b5b, processorArchitecture=MSIL</Assembly>
<FullClassName>MyAddin1.Connect</FullClassName>
<LoadBehavior>1</LoadBehavior>
<CommandPreload>1</CommandPreload>
<CommandLineSafe>0</CommandLineSafe>
</Addin>
Hope that gets your addin loading!
Sincerely,
Aaron Marten
Igor L. Kravchenko
Strange, that same string works for me from the Project Templates.
I have never needed to add processorArchitecture, I have also never needed that in any projects, or seen it in samples.
Can you explain why you think I might need that (don't worry, i will try it later today when I get back to my addin), i am jsut curious why that is a road to try.
You said it worked for you, can you post for me your ".AddIn" file for me to compare to With the GACerized mention.
Thanks alot,
Jonathan
Kartit
Yeah, cool, that worked out.... it's good you found that.
It seems a little ridiculous though, becuase if you look at every other place in the framework where you use those kinds of refences, full types, machine.config, web.config, etc... the processorArchitecture is never shown, and never a requirement.
Seems like the dev's in charge of loading addin's felt they needed to be stricter than everyone else. The issue being that is never documented, on the MSDN docs it talk sbout loading from file, full path, and URL.
I had to guess that GAC was an option, and if you had not realized that minor addon to my string, it would never have worked. I wonder how many people just assume it doesnt work as opposed to asking a bunch of geniuses on MSDN Forums :-)
In any case, Thanks alot for you help and time... I am really enjoying thsi VSIP extensibility stuff, but it is a bit different, and tricky than some other stuff I have been on. Just less intuitive, but I have a feeling that is becuase it depends and uses a lot of old VB and VS 6 type things ( Like the CommandBar that keeps returning com_objects ) so it's alot of trial error and not so much logic to figure out what you are supposed to cast something to make it useable.
Gary Trembath
Hi jminond,
I just tried, and I was able to get an addin to load from the GAC. I think the string in your <assembly> tag is wrong. You can find out the exact string from running "gacutil -l GBM.EnviromentDTE".
For example, you might need to add 'processorArchitecture=MSIL' if you have a normal .NET assembly.
Let me know how it goes.
Sincerely,
Aaron Marten (Microsoft Corp)
bhavu
I think I jumped the gun when I said it worked, and I didn't realize it was still picking up my older version or something, not sure. I was out yesterday or I would have followed up sooner.
I have removed all the loose assemblies everywhere, and the only remaing DLL with my code is in the GAC.
GBM.EnviromentDTE
Version=1.10.10.15
Culture=neutral
PublicKeyToken=80d799f04f11805c
processorArchitecture=MSIL
( It has a policy file also, not sure that effets anything though, as there is only one installed version right now anyway ).
<
Addin><FriendlyName>GBM VS Enviroment</FriendlyName>
<Description>GBMVSEnviroment - Adds GBM Specific functionality to your VSIP</Description>
<Assembly>GBM.EnviromentDTE, Version=1.10.10.15, Culture=neutral, PublicKeyToken=80d799f04f11805c, processorArchitecture=MSIL</Assembly>
<FullClassName>GBMVSEnviroment.Addins.Connect</FullClassName>
<LoadBehavior>1</LoadBehavior>
<CommandPreload>1</CommandPreload>
<CommandLineSafe>0</CommandLineSafe>
<AboutBoxDetails>For add-in support, Email: jonathan.minond@rbsgc.com.</AboutBoxDetails>
</Addin>
In my addin folder I have the addin file "GBMVSEnviroment.AddIn"
Now when I go to start VS.NET it throws an exception
Error MEssage: The System Cannot Find the file specified.
Error Number : 80070002
"AboutBoxDetails" is new, and does not change weather the add in loads or not.
Hasan9552
Is it possible that becuase my addin.dll is compiled in DEbug mode, that has some effect I don't think so, becuase I can actually "Debug" it stepping thorugh, if i switch from GAC to local dll copy in addin folder ( to test the gac, i delete the local dll copy ).
Also, I notice in my evenlog, "One or more Visual Studio templates is invalid and will not be displayed. "
I don't think this is related, befcuase I don't deal with any tempaltes in my addin.