How to add and run an additional manifest in a VSTO Add-in - visual-studio

I have a VSTO Add-in in C# for Excel in Visual Studio 2017.
I also have a manifest which references a Web Add-in for Excel.
I'd like to add the manifest to the VS project so that when the user installs the VSTO add-in, the web add-in will be installed as well.
I have found several ways to add a manifest to a VS project:
1. Create the manifest through New File -> Add Manifest Application File
2. Add a Web Add-in to a solution
However, these 2 ways aren't enough to achieve what I'm trying to do.
With the first method, the manifest is added to the project, but nothing reads it so it is never loaded.
Moreover, I thought I could specify it as an additional manifest, but VS doesn't let me embed it:
With the second method, I successfully added a Web add-in project to my solution.
When set as additional start up project, it loads and runs correctly on debug mode.
However, when I build my solution, the web add-in doesn't generate anything, so it isn't embeded in my installer (I'm using Wix 3.11 to generate a .msi installer), and thus, it is never run when I install the add-in.
How can I add and read the manifest in my solution so it will run upon installation?
EDIT:
I have also found this to use AdditionalManifestFile in (I believe) the .csproj of a project, however this doesn't work either.

Related

VSTO Outlook: HOWTO add a manifest file app.manifest

I have an VSTO Outlook Add-in which uses some WPF components. I have some problems on WPF components to be rendered correctly. For example, some objects are shown more bigger, etc. I have found a possible solution described here when you mix winform and wpf components. May I guess VSTO Outlook addin in fact are winforms? So I need to specify some configuration in an app.manifest file and I do not know how to create the manifest file. I don't know if the process to create it is the same as a normal winforms app or in case of an Outlook VSTO Add-in is different.
In the link I provided above it is explained to add some setting in the assemblyinfo.cs file, ok there is no problem with it, i have done it, but now I do not know how to add some settings to the app.manifest file. I have seen in the \bin\release folder I have an myAddin.dll.manifest but this file is created automatically when you build the Add-in so i guess i cannot touch it because if so it will be overwritten again when I do a new build/rebuild of my add-in. Also the content within myAddin.dll.manifest, from where is taken?
Please could you indicate me the steps i must follow?
UPDATE:
This link says application manifest file is created automatically, as I was guessing.
Application manifests are created automatically as part of the build
process.
So is there any way to create a post-build action to add a custom setting to application manifest?
One possibility would be to modify the manifest MyAddin.dll.manifest after build process suceed but i would like to automate it. Also i am wondering if there is the possibility to create an additional manifest file and Visual Studio merge it with the default one during the building process.
VSTO add-ins are not standalone applications like Windows Forms. The manifest file is created per-application, not add-in. So, the best what you could do is to create a manifest file for the host application which is Outlook in your case. The manifest file should be named in the following way:
Outlook.exe.manifest
and should be placed to the same folder with Outlook.exe application.
So, if you need to make changes with a manifest file they will be applied to the whole host application (Outlook) and have impact on all add-ins, not only yours.
The manifest works on the application level (exe), but VSTO addins are dlls hosted by outlook.exe, and you cannot add or update its manifest.

VSTO installer and Deployment Manifest file

I am trying to make an installer for a PowerPoint Addin using Visual Studio Installer.
The installer installs each required files but does not execute the VSTO Deployment Manifest, and then my add-in is not included in PowerPoint.
I went to Custom Actions menu and wants to add the action of executing VSTO Deployment Manifest file but I have the following error: not a valid file type for a custom action (it seems to expect .exe .dll .vbs or .js files).
I have searched similar questions and found it but even if the error message is the same, I think the problem is different.
Do you know how to solve it and execute the VSTO Deployment Manifest file?

Deploy a VSPackage to create a new project type using Setup Project

I create a new custom project type using a VSPackage project inheriting of MPF library (http://mpfproj11.codeplex.com/). As a result I obtain a .vsix but I need add this project type using a .msi. I'm using the Visual Studio 2010 Setup projet for it. In my setup project I add the content of the VS Package in the same directory where the .vsix put then, but I think Ineed to put in the registre the new type of project because when I use the setup , the project template does not come out in Visual Studio and when I give double click the file with extension of the type of new project and does not recognize it. When I look the registry after install the vsix, this was one of the things that I found diferent. I add this entries in my setup project but It's not working yet.I'm missing something else?
In the projecttemplatedir is the directory where I put the .dll of the project type, the vsixmifest and pkgdef. The project template is in [User]\Documents\Visual Studio 2013\Templates\ProjectTemplates\[Name of new Project Type]\[projecttemplate.zip]
Best Regards
PS: The project type is for VS 2013 but I'm using the VS 2010 Setup project ;)
OK, so first the "don't"s of doing this:
In general, if you are installing via MSI you shouldn't be doing anything user-specific -- no writing in HKEY_CURRENT_USER, nor writing within their Documents folder, LocalAppData, or Visual Studio folders, etc. If you see yourself writing files or registry keys in either of those places, that should be your hint that there's a better way to do what you're trying to do. For what you've shown so far, this raises more than a few red flags for me.
Second, don't ever go writing keys into 12.0_Config. That part of the hive is nothing more than a cache that's built up from other parts of the registry and on-disk .pkgdef files from extensions. It's rebuilt in any number of senarios, including installing new extensions. Any writes there you should presume will get blown away at any time. If you need to write things there you should either (a) write in HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\[version] and run devenv /setup or (2) [preferred] put your keys in a .pkgdef inside your extension which gets merged into 12.0_Config for you automatically.
Now the dos:
You said you already had a .vsix produced by the SDK: you can put project templates in there. You can then register those templates in the .vsixmanifest and those will pull in. That's far easier than mucking around with files in Documents -- that's the user's directory...don't go playing with that.
Once you have a .vsix that does most of what you need, you should simply take the files within that and install the files in a folder within C:\Program Files [(x86)]\Microsoft Visual Studio 12.0\Common7\IDE\Extensions. Even better, you might just want to WiX toolset to build your installer, since it has built-in support for installing extensions. It also has built-in support for invoking the "/setup" process if that's what you need to do as well. Visual Studio Setup projects are no longer supported in newer versions of Visual Studio, so you're better off starting with a technology that isn't already obsolete. WiX is even what we use at Microsoft to do the setup work for Visual Studio itself, so it's definitely up to the task.
Last point: almost everything when it comes to Visual Studio extensibility can be done with a VSIX directly, so presume there's a good way to do something that way before falling back to an MSI. Internally, we can register the entire C# and VB language services with just a VSIX -- they're quite powerful.
I found the answer in this link Registering Project and Item Templates. I set projecttemplatedir entry with
[User]\Documents\Visual Studio 2013\Templates\ProjectTemplates[Name of new Project Type][projecttemplate.zip] that is where i put the project template.

Is it possible to provide custom content for the VS2012 Start Page?

Visual Studio 2012 (and 2010, too) has a Start Page that has links and streamed videos. Is it possible for my package to provide content on this page, e.g., create a separate section next to Welcome/Windows 8/etc.?
I finally got a custom start page working in VS2012 - my issue was I could not install the Start Page Project Template in 2012 as the extension only installs on 2010 (which I don't have access to) and my My Documents folder is mapped to a network drive, so putting the raw XAML file in My Documents/Visual Studio 2012/Startpages didn't work as Visual Studio refused to use this "untrustworthy file".
Download the Start Page Template from here.
Rename the file to .zip and extract it.
Copy the "\Solution\CSharp\Extensibility\StartPage.zip" file to your project template folder (by default "My Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual C#").
Create a new project using this template.
Follow the instructions here to upgrade from 2010 to 2012 start page.
Update the project properties target framework to 4.5.
Update the project references in the Control project by removing the Microsoft.VisualStudio.Shell.10.0 reference and adding the Microsoft.VisualStudio.Shell.11.0 and Microsoft.VisualStudio.Shell.Immutable.11.0 references.
Update the namespaces references in the xaml file by replacing the existing ones with the two below.
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0"
xmlns:vsfxim="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.Immutable.11.0"
Replace the references to vsfx:VsBrushes keys to vs:EnvironmentColors keys, e.g. vsfx:VsBrushes.StartPageBackgroundKey to vs:EnvironmentColors.StartPageTabBackgroundBrushKey
In the VSIX project, make the following changes to the source.extension.vsixmanifest file (values depending on if 2010 support is desired, it is not for me):
Add an author, the default empty tag is not allowed: <Author>Ken</Author>
Change/add the visual studio support version to 11.0: <VisualStudio Version="11.0">
Change the supported runtime edition to include 4.5: <SupportedFrameworkRuntimeEdition MinVersion="4.5" MaxVersion="4.5" />
The VSIX solution should now build and spit out a VSIX file in the project bin folder. Install this and you can now choose your Start Page from the drop down list in the visual studio options.
I haven't actually developed my custom start page beyond this, but hopefully it is a helpful to people wanting to get started developing them with VS2012
EDIT: A project which includes a basic 2012 start page, custom control and can be deployed via VSIX: template
Custom Start Pages, via google:
http://msdn.microsoft.com/en-us/library/aa991992.aspx

Outlook Add-ins manifest and Installer folder VSTO

I'm developing an outlook addins vsto using visual studio 2010,
When I publish my project I found a new install folder inside "Application Files\MyAddin_version\Installer\MyAddin.exe.deply"
This is a new file with the deploy, before I was able to deploy without this file.
My question, what setting in my build generate this file?
The problem every time I build my project now I found in the manifest file the new entry:
I'm pretty sure the entry was not found in the old builds, I didn't change the code, but I was trying to change the build and publish, switching between local publish and UNC and http.
(Need to remove this new entry, don't need it every time i build, it causes problem.)
Many Thanks
Sorry it was a bug in my solution, some files were marked as content in the build actions.

Resources