How to deploy an Office VSTO add-in using Visual Studio 2017 - deployment

I've created an Outlook add-in, debugged and works fine. I want to be able to package it up for distribution. This is for a very limited audience 5-10 people. What are the steps to doing so?
I tried Build | Publish which appears to work (using options of local filename and CDROM install location), but creates a massive 1.5MB setup.exe file and when it is executed, takes forever (it appears trying to contact some remote server and times out and pops an error, although the add-in appears to be registered).
Looking online, I found references to creating a SetupProject or using InstallShield Limited addition, but none of those appear to apply to Visual Studio 2017.
I'd be happy if I could just provide my DLL and a .reg file -- this is for a small set of 5-10 power users.
What is the simplest way to deploy this add-in?

The easiest way is Build | Publish. Just disable any online activities if you don't want it. You can do that in Project -> Settings -> Publish. Check your "Updates" settings for example.

You can download a Visual Studio project type from here:
https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects
This will allow you to deploy the package, but it's somewhat buggy in my opinion. Also, the link above does not have any documentation. You have to go to another page for that and the answer is buried in the comments:
https://msdn.microsoft.com/en-us/library/ybshs20f(v=vs.90).aspx
The ClickOnce has worked more consistently for us, however. Just right-click and select Publish on the Project.
It is a long ways off from the old InstallShield LE process, which allowed you to customize the entire process including images, click-through licensing, etc.
But the InstallShield LE had it's own set of issues, and seems to have been all but abandoned.
It may be worth looking at other 3rd-party tools like WiX (http://wixtoolset.org/) to get things installed correctly, or even manually writing your own installer to get things put where they need to be.

Related

How to re-add a deleted VSTO Add-In

I've got a strange issue with a Word VSTO add-in on one machine where running the visual studio project opens word but does not attempt to start the add in as far as I can tell.
I got to this point because I accidentally clicked Remove for the Add-in on the Manage COM Add-ins page, instead of re-enabling it after a failure.
I want to know how to re-enable a deleted add-in - I'm thinking that perhaps there is a registry key somewhere I need to get rid of.
When I run the project from Visual Studio it does not attempt to
start up at all, Word starts instantly with no "something-is-failing"
type pause.
No breakpoints in ThisAddIn_Startup are hit.
In Word : File/Options/Add-ins - the add-in does not appear under Inactive or Disabled Addins
Word : Manage COM Add-ins Go... it does not appear.
Word : Manage Disabled Items Go... is empty.
I've tried installing and uninstalling the published version, to see if that wakes anything up, and I've tried changing the path of the VS project, just in case that makes a difference (and various restarts, cleans, rebuilds, locally deleting and re-cloning from git etc) but I can't find a way to get this to work again. On a different machine, cloning the add-in from Git and opening it in Visual Studio and its all fine.
I've tried re-adding via the select DLL (or select .) dialog on the COM Add-ins but nothing I select appears to be a valid add-in.
Any help to figure out how to get back to a working development environment would be appreciated.
EDIT
There's a lot going on below - so I thought I'd clarify that the successful solution was the online-repair of Office
What is the LoadBehaviour in the registry? It should be 3...
To find out, look in
32bit Word => Root\Software\Microsoft\Office\Word\Addins\add-in ID
64bit Word => Root\Software\Wow6432Node\Microsoft\Office\Word\Addins\add-in ID
where Root is HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE, depending on whether the addin is installed for current user or everyone.
If the value for LoadBehaviour is not 3, then change it to 3 and restart Word.
Here is the Microsoft docs about it: Registry entries for VSTO Add-ins
If it still does not work, try to re-enable as it might be hard disabled:
In the Manage box, change COM Add-ins to Disabled Add-ins, and click Go.
Select the add-in and click Enable. Click Close. Now the add-in can be loaded again...
Back in the Manage box, change Disabled Add-ins to COM Add-ins, and then click Go.
Check the checkbox next to the disabled add-in. Click OK.
Here is the Microsoft docs about it: How to: Re-enable a VSTO Add-in that has been disabled
Also, if you haven't done this already, it is worth setting VSTO_SUPPRESSDISPLAYALERTS to 0 as described on this page: How do I enable VSTO error / display alerts?
If none of the above helps, then it is worth doing a Online repair of Office from Add or Remove Programs.
I believe that you need to change the version of the VSTO add-in in order to be able to update it or re-install it. Once an add-in version has been disabled, this is permanent.
See Uninstall MS Word Add-in for details. Let me know if that worked.
The most extreme steps I've had to take when things aren't working as expected are to clear out the VSTA cache, either in the registry or the filesystem. Note that I work with template-based customizations that are attached to documents, not add-ins that are always present, so this may not apply to you. Or maybe it does, I don't know.
Registry
Look for an entry for your add-in under HKCU:\Software\Microsoft\VSTA\Solutions. I use PowerShell for this, and an example command chain would be something like this:
gci "HKCU:\Software\Microsoft\VSTA\Solutions"
Hive: HKEY_CURRENT_USER\Software\Microsoft\VSTA\Solutions
Name Property
---- --------
1234abcd-1234-abcd-1234-abcd12 Url : file:///Z:/path/to/your/addin.vsto
34abcd SubscriptionID : addin.vsto, Culture=neutral, PublicKeyToken=<removed>, processorArchitecture=msil
ApplicationID : file:///Z:/path/to/your/addin.vsto#addin.vsto, Version=<removed>, Culture=neutral,
PublicKeyToken=<removed>, processorArchitecture=msil/addin.dll, Version=<removed>, Culture=neutral, PublicKeyToken=<removed>,
processorArchitecture=msil, type=win32
ProductName : addin
LastCheckedTime : {4, 201, 185, 1...}
UpdateEnabled : 1
UpdateInterval : 1
UpdateIntervalUnits : days
remove-item "HKCU:\Software\Microsoft\VSTA\Solutions\1234abcd-1234-abcd-1234-abcd1234abcd"
Filesystem
My customizations (see note at the start) are installed at %localappdata%\Apps\2.0 and on rare occasions I need to delete them manually. Clearing this one out is less straightforward, but usually there's a single anonymized folder like ABCDEFG0.QWE. I just delete that, and along with the other half of this, I've never run into a problem I couldn't solve. FYI if you have multiple deployments this might uninstall all of them. I don't do it very often so I'm not 100% familiar with how this area works, but I've never made anything worse by doing this.
I don't know how this differs, if at all, for application-level add-ins, that can be installed to Program Files.
Edit: adding some relevant links.
How do I completely uninstall a ClickOnce application from my computer?
Clear the .NET-downloaded application cache without Mage?
I faced the same problem. At first I deleted the corresponding registry key for the addin (The registry path can be found in the other answers). After that I tried Build > Clean Solution and after that Rebuild Solution. That solved the issue.

Removing references from renamed VSTS project (not TFS)

I had deleted a project from VSTS and would like to use the same name again for my project but when I try to create the project, I get this error:
All of the desktops that this message is referring to are gone e.g. old employees, virtual desktops, etc.
How do I get past this error? I'd hate to retire a project name because of old desktops or ex-employees that will never access this project again.
UPDATE:
When you know what you're doing, everything is easy and questions like mine are frowned upon, so much so that someone suggested this post should be closed. Very nice!
So, I'm told both TFS and VSTS work the same way and I should go learn what I need to learn from the other post. According to the linked post, I need to go run TF command which according to the answers is located in Visual Studio 20xx/Common7/IDE folder. I go there and TF.exe is NOT there. I then start searching my computer to locate this executable and my computer can't find it. I then Google it and here's what I see on Microsoft's documentation. What gives?????
Regarding VS2017, the Tf.exe is in C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer, you also can call TF command in Developer Command Prompt for VS 2017.
On the other hand, you also can remove workspaces through Visual Studio directly (Manage workspaces and check Show remote workspaces option)

Team foundation server on the Mac with Vim

I'm using Vim on a Mac for front-end development and was recently hired at the company that uses Team Foundation Server as their version control system.
I would hate to have to switch to using Visual Studio on Windows because I'm so used to Vim and the Mac.
I found this and was hoping that would be a possible solution. I would still like to avoid editing code in Eclipse. However I wouldn't mind opening Eclipse to do version control stuff.
I'm very unfamiliar with Eclipse and Team Foundation Server (not VCS in general) and I need some advice on how to actually use it.
I'm able to connect to the server and find the project I have to work on, but from here I'm lost. This is the window I'm stuck at.
Anyone who are in a similar situation and could offer some help?
You've done the hard bit I think, firstly you should be able to safely ignore the Work Item and Build "folders" unless someone explicity tells you to use work items, at which point they can show you what you need to know as it works exactly the same as in Visual Studio.
If you double click on the Source Control folder it will open a new window which will show you the source "tree". To be able to Get, Checkout and add source files to the tree you'll need to set up a workspace. Once you've done this then you can get the code and check out.
With Team Explorer Everywhere You also have the option of using the tf command line in the Mac terminal. This would eliminate the need for eclipse. (I'm assuming that as a Vim user you're not afraid to use the terminal)
Another option might be svnBridge however I think you need the server version if you're using a Mac, and this requires a site to be installed in the TFS application server which might not be an option.
Finally TFS now offers support for integration with GIT.

Best option for check-in/out with small team using Visual Studio 2012?

I have a small team of web developers who work together on up to 50 external sites. I am trying to find a better solution to using Dreamweaver's check-in check-out for managing source. We have just started using Visual Studio 2012 here and there and I am curious if TFS is the way to go for us. No one here has ever used versioning or any type of source control before, so I am looking for something similar to what they are used to.
If it matters at all, our sites are all hosted on a Windows 2008 R2 server, and largely written in C#.
I think TFS is a good option to consider. As several people have commented, it will be a jump from what you are your team are used to in Dreamweaver, but I personally feel if you are serious about managing your intellectual property, you will invest in some sort of version control system. With that said, there will be a learning curve regardless whether you are your team select TFS, SVN, Git, etc.
Assuming you do go with TFS, you do get the added benefit of everything else that comes with TFS - it's not just about version control. This includes work item tracking, automated builds/deployments, reports, a simple SharePoint site, etc.
With TFS you get the benefit of all of these features, combined into a single product. You can accomplish a similar setup using open source products as well, but would require you to piece the products together.
I'd use the integrated Subversion client in Dreamweaver, which does the basic stuff very nicely and doesn't require the tedious navigation process that will lead to your team bypassing the system. Only problem, DW does not support the latest versions of SVN so you need to pick up an SVN server that is compatible. Try this:
Setting Up Version Control for Dreamweaver CS6 on Windows
Any previous attempts to get version control working may well have created some .svn folders and files on your PC. You MUST remove ALL of these and UNINSTALL ALL OTHER VARIETIES of Subversion software from your PC before you start.
Go to the VisualSVN Server website and download an archived standard version of their software, version 2.1.16 . Don’t be tempted to grab a later version, because this will install SVN 1.7 or 1.8 and neither will work with Dreamweaver.
http://www.visualsvn.com/server/changes/
Trying to get DW working direct to a local folder using the file:// protocol probably won’t work and is also known to put data at risk. You need the server. I chose to install the VisualSVN server with the default settings, other than opting to use Windows logins and go with HTTP, not HTTPS. I decided to have the repositories live on an internal SSD drive, but any local drive will do. When creating a folder for your repositories to live in, use a name that is pretty general e.g. ourcorepositories . I used lower case for everything.
Right click on ‘Repositories’ to create a new one. Give it a name without any spaces or special characters e.g. mynewprojectrepo and check to ‘Create default structure’ . Before you OK, note the Repository URL and copy it into Notepad or a similar plain text editor so you can refer to it later during 6 below. It will be something like
http://OFFICEDESKTOP/svn/mynewprojectrepo
Notice that the capitalised part of the URL is the name of your computer. Click OK and you now have a repository for your project.
5. Boot DW and go to your project. If you don’t have a project yet, create one and stick some dummy files and folders in it. Go to Site menu>>Manage sites… and 2-click your project. Select Version Control.
6. Set Access to be ‘Subversion’ (no other choices exist), Protocol to be HTTP and for the Server Address enter the name of your computer in lower case e.g.
officedesktop
For the Repository Path enter (e.g., using current example from 4. Above)
/svn/mynewprojectrepo
The Server Port should be 80 . For the Username enter your Windows user name, in lower case. Enter your Windows password for the Password. This is the name and password combo that you use to log in to your PC . Click the Test button and you should get a success message. If not, the best advice is to delete any .svn files and repositories you have created and start again. Be sure not to add any slashes or omit any; the above works. Before you click Save, click the link to the Adobe Subversion resources and bookmark it in your browser. There is a lot of useful background information there. Click Save, click Done.
7. Go to your DW project and open up Local View. All of your site’s files and folders will have a green + sign beside the icon. Right-click on the site folder and click ‘Version control>>Commit” . It is a very good idea to leave comments whenever you change anything, so leave a Commit Message along the lines of “The initial commit for My New Project” and click to Commit. If you have a lot of files to go to the repository, they’ll take some time to upload. As they upload, the green + signs disappear to show that you local version is in synch with the repo.
8. Okay, that’s it, you have Version Control in Dreamweaver CS6. It may also work in CS5 and 5.5. Check out those Adobe resources for some good insights on workflow. I can’t help with any other ways to implement version control, but I can maybe save you time by saying that DW doesn’t integrate with Git and that the basic, but integrated, Subversion client in Dreamweaver is way better than having no version control. For coverage against physical disaster, I’d also add in a scheduled daily backup of your entire repositories folder to some cloud storage.
Apologies for any errors. I’d recheck all of the steps, but A) I think they’ll get you up and running and B) it’s easier to do the install and set up the first time than the second time (all those .svn files and folders to get rid of).

How do you deploy a website and database project using TFS 2010?

I've been trying to figure this out and so far haven't found a simple solution. Is it really that hard to deploy a database project (and a web site) using TFS 2010 as part of the build process?
I've found one example that involved lots of complicated checks and editing the workflow (which is a giant workflow btw).
I've even purchased the book "professional application lifecycle management with VS 2010", but apparently professionals don't deploy their applications since it isn't even mentioned in the book.
I know I'm retarded when it comes to TFS, but it seems like there should be any easy way to do this. Is there?
I can't speak for the database portion, but I just went through this on the web portion, the magic part is not very well documented component, namely the MSBuild Parameters.
In your build definition:
Process on the Left
Required > Items to Build > Configurations to Build
Edit, add a new one, for this example
Configuration: Dev (I cover how to create a configuration below)
Platform: Any CPU
Advanced > MSBuild Process
Use the following arguments (at least for me, your publish method may vary).
MsBuild Params:
/p:MSDeployServiceURL="http://myserver"
/p:MSDeployPublishMethod=RemoteAgent
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=True
/p:username=aduser
/p:password=adpassword
Requirements:
You need to install the MS Deploy Remote Agent Service on the destination web server, MSDeploy needs to be on the Build/Deployer server as well, but this should be the case by default.
The account you use in the params above needs admin access, at least to IIS...I'm not sure what the minimum permission requirements are.
You configure which WebSite/Virtual Directory the site goes to in the Web project you're deploying. Personally I have a build configuration for each environment, this makes the builds very easy to handle and organize. For example we have Release, Debug and Dev (there are more but for this example that's it). Only the Web project has a Dev configuration.
To do this, right click the solution, Configuration Manager..., On the web project click the configuration drop down, click New.... Give it a name, "Dev" for this example, copy settings from debug or release, whatever matches closest to what your deployment server environment should be. Make sure "Create new solution configurations" is checked, it is by default. After creating this, change the configuration dropdown on the solution to the new Dev one, and Any CPU...make sure your projects are all correct, I had some flipping to x86 and x64 randomly, not sure of the exact cause of that).
In your web project, right click, properties. On the left, click Package/Publish Web (you'll also want to mess with the other Package/Publish SQL tab, but I can't speak to that). In the options on the right click Create deployment package as a zip file. The default location is fine, the next textbox I didn't find documented anywhere. The format is this: WebSite/Virtual Directory, so if you have a site called "BuildSite" in IIS with no virtual directory (app == site root), you would have BuildSite only in this box. If it was in a virtual directory, you might have Default Web Site/BuildVirtualDirectory.
After you set all that, make sure to check-in the solution and web project so the build server has the configuration changes you made, then kick off a build :)
If you have more questions, I recommend you watch this video by Vishal Joshi, specifically around 22 and 59 minutes in, he covers the database portion as well...but I have no actual experience trying it since we're on top of a non MSSQL database.