How to test an office excel add-in with other computer - visual-studio

I'm newly developing office Add-Ins. I was able to create an Excel add-in using visual studio 2019 with Office / SharePoint development workload (JavaScrip APIs). It was possible to test on my own excel desktop when I press the start button in Visual studio, but I need a test on another computer. I'm planning to publicize this app on AppSource and OfficeStore.
Checking Microsoft's documentation and some other questions here at Stackoverflow I understood that the recommended way to test is: SideLoad.
Microsoft's Documentation about testing and debugging office
add-ins
Test office Add-ins - StackOverflow
Overall Testing Story for Office Add-ins
On the other hand, when I started on my desktop the WebApp(task pane) was host in the IIS server as localhost. So, I created a shared folder and put the manifest archive that was available in my machine on the path: Office add-in\ExcelWebAddIn1\bin\Release\OfficeAppManifests. Besides that, accessing another computer I set the trust manually and it works. On the other hand, when I accessed the excel> insert>add-in>myadd-ins> down arrow is not possible to keep going with Microsoft's documentation, and the add-in is not there!
If I try file>options>add-ins is not there too!
Sideload Office Add-ins for testing from a network share
Is it necessary to host the web app on a real server or Azure before following these steps? or Is it necessary to publish the solution? Besides that how can I include the manifest in excel?

To test an add-in on a machine that is not the machine where the add-in's web app is running, you cannot use "localhost" in the manifest. The manifest must point to the HTTPS URL of the web app.

I have done the following:
installed and used Node.js
edited taskpane files etc on node server
in a browser, visited localhost:3000/taskpane.html and other files, and copied source generated
on a webserver, placed these generated files, and copied links to these files (only one html and one js needed)
repalced links in manifest.xml to html file, and in .html file to .js file
re-upload manifest.xml to reflect changes
It works, with some errors being thrown in the console output.
It does mean that you need to repeat the steps above each time, except for the upload of the manifest.xml.

Related

Deploy Outlook/Word/Excel Addins with custom internal website

I have an outlook addin that I currently deploy by telling the users to browse with windows explorer to a specific file on a share.
I would like to change that such that I would tell the users to browse to a specific internal website using edge/chrome. Then click on a link to install the addin.
I want to change from file system to browser based so I can deploy it much like any other website we have. I have add good instructions on the webpage with the link and any number of other advantages.
The file system supports automatic updating as we update the addin and I would want the browser based install to support the same thing.
The best what you can do is to publish a manifest URL so users could add it instead if file path on the shared place (of course, if the add-in is not published in the AppStore). You can find all possible ways of deploying Office web add-ins described in the Deploy and publish Office Add-ins article.

Deploying single files to Dynamics 365 while developing (e.g. web resources)

I am developing my first simple app in Dynamics 365, and one of my main pieces is a Web Resource that involves a lot of tweak-save-test-repeat workflow. Up to this point, every time I have made a tiny change to my web resource, I have been deploying it by opening the solution customization settings, navigating to my particular Web Resource, opening it, clicking "Text Editor" button, pasting in my updated Javascript code, and saving/publishing the changes.
This process is tedious, and I would like to find a way to automate it. I have been researching Dynamics 365 deployment tools, and I have found the CRM Package Deployer tool, but from what I can find it requires me to set up an entire deployment package (a giant XML file) comprising my entire customization, rather than the single file I am currently working on. Is there some way to automate deploying a SINGLE FILE with these (or other) tools? Or is it possible to deploy a package with ONLY A SINGLE FILE rather than re-deploying the entire solution's package each time I just change the one file?
Check out the open source alternative to the SDK's developer toolkit called Dynamics CRM & 365 Developer Extensions which you can install right into VS. It makes deployment of web resources a snap. Basically, you map individual JS/Html/Css/etc files to their corresponding web resources in CRM, and then once they are mapped all you have to do to deploy is right-click and choose Publish to CRM.
That tool is great, but if you really want to speed up your web resource development, you should use Fiddler. In Fiddler, turn on Autoresponder and setup a mapping for the file you are working on. When Fiddler sees a request that matches a mapping, it doesn't send the request to the server and instead returns the file from your hard drive. This technique offers a dramatic speed improvements for developing web resources. There's also a free tool for Fiddler called Imposter that makes the process easier. Search the web for "dynamics crm fiddler web resources" to read about this technique.
Another tool is the Web Resource Manager in the XrmToolBox It's free, a part of the XrmToolBox, and even handles pushing .map and .ts files you're doing TypeScript. It will warn you if someone else has updated the file since you have, and allows you to push, publish, or even add the files to a particular solution.
Another lightweight Visual Studio Add-in, which allows for deploying single (or multiple) web resource file to CRM without leaving Visual Studio is
Microsoft Dynamics CRM Web Resources Updater:
https://marketplace.visualstudio.com/items?itemName=MaratVDeykun.MicrosoftDynamicsCRMWebResourcesUpdater
There is also a commercial solution called XrmToolkit which can be set to automatically publish to CRM when you save the web resource file in Visual Studio:
https://www.xrmtoolkit.com/

Make Visual Studio work on source files developed under Mac

I use Emacs for Mac to develop Excel add-ins, and test and debug them in Excel Online and Chrome DevTools. All the source files (.xml, .html, .js, .css) are put in one folder at the same level. The folder contains no more than 10 files in total, and we can add it to workspace in Chrome DevTools, which synchronises quite well with Emacs.
Once an add-in has been built more or less, I need to test (and thus debug) it further in Excel for Windows, which is more used by professionals and supports more complex Excel files than Excel Online. I install Windows as a virtual machine, which has access to files in Mac.
To debug an add-in in Excel for Windows, we have to use Visual Studio, I see how to create an add-in project from scratch in Visual Studio.
However, the question is, whether it is possible to build a project in Visual Studio, which is based on existing source files of an add-in (in one folder and at the same level). I guess only when we code and debug on the same source files across Windows (Visual Studio) and Mac (Emacs), we could keep the files synchronised.
Does anyone know what is the best practice?
If you're looking for the fully interactive debug experience from Visual Studio (ie. Hit F5 and have the website, debugger and Excel all spin up at once) then this does require Visual Studio ASP.NET.
That said, you do not need to use Visual Studio to build Add-ins. All that is required is a Manifest and a Web App hosted over HTTPS. The last part is the tricky bit since you likely don't have a valid SSL Cert running on your local Mac that is also trusted on the PC. You could solve this by trusting that cert in Windows but if you're not familiar with how the Certificate Manager works it may be an exercise in frustration.
The easiest way around this is using an Azure. Web Apps have a Free tier so it won't cost anything to spin it up and they include a valid SSL cert out of the box. Once you push your site up into Azure you simply need to edit the Manifest file and give it your Web App URL as the source location (i.e. https://mytestsite.azurewebsites.net/index.html).
In order to sideload the Add-in into Excel for Windows, you'll want to place the Manifest into a shared folder (SMB share). Within Excel you add that network share as a "Trusted Catalog" after which any manifest placed in that directory will show up in Excel for Windows.

How to deploy a Web API to my web host?

I'm building a RESTful Web API on my local machine and it works nicely. I want to put it on my GoDaddy web host account now. I did this once by copy and paste file by file to the FTP site they gave me. That worked, but it is slow and painful to do and to update when I make changes. Is there a quicker way to publish (in Visual Studio) from my local copy to my FTP site? If not, can you tell me which files I need to deploy for the Web API to work? I don't think it needs all the .cs files, but I'm not sure what files it must have.
OK, I found this link about publishing a website in Visual Studio:
https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k%28WebApplicationProjects.PackagePublishOverview%29;k%28TargetFrameworkMoniker-.NETFramework
It didn't really solve everything for me, but I started playing around with the controls in Visual Studio. I was able to publish my local website to FTP by right-clicking on the project node in Server Explorer and click Publish... or click Build -> Publish in the Visual Studio menu. Fill in your FTP connection information, enter the target folder under Site Path and leave Destination URL blank (don't know, don't care). I also unchecked "Include all databases..." in the Project Properties Page for Package/Publish Web because I didn't want to rebuild my destination database. It worked.

How can I host Office add-ins on localhost?

I'm new to web-servers. I have Internet Information Services (IIS) 10 Express installed on Windows 10. I'm trying to develop an Office add-in so as to host it in the same computer I use. The problem is how do I host the add-in in a local web server? Since I'm new would appreciate a little of step by step answer.
while you are developing the add-in, you do not need to worry about a local web server. The Visual Studio tools take care of all that for you (it will run in a web server provided by Visual Studio).
If you are using Visual Studio 2015 (the community edition is free and works fine with Office add-ins), you simply create a new 'office add-in' project and it will all be set up for you. It will create a 'web project' for you and it will use that web project when you run the application locally - you do not need to do anything to make that happen.
You may find that you have to install the Office tools for Visual Studio but if you go to File > New > Project > Visual C# > Office/SharePoint you'll get a link to download the tools if you do not already have them.
In terms of hosting it in the public domain, I like to use the Azure Web App service as you can very easily publish directly from Visual Studio or you can setup continuous integration with GitHub, VSO etc. Once you have it hosted in the public domain, you simply change the 'Source Location' in your office add-in manifest file to point at your public URL.
Well I figured it out.
Except it broke my VS Setup now (Resolved)--> See here Installing IIS broke Visual Studio Office Add In Project Localhost
To enable IIS I had to open "Programs and Features" and select "Internet Information Systems".
Then start --> IIS. Browse to default site and added binding for SSL/Port 44367 (Same as VS). I already had a SSL cert from previous configurations, selecting the Dev Cert worked fine.
I copied everything from \ExcelWebAddIn1\ExcelWebAddIn1Web\* to the webroot C:\inetpub\wwwroot and adjusted the following in manifest.
replace:
~remoteAppUrl
with
https://localhost:44367
I then sideloaded the manifest and it worked as expected.
Note that Martin Kearn's answer still applies, this isn't needed if you want to just use VS and it has better debugging, but I wanted to test and learn.
This was all to test/debug deployment, and I was able to do the same by just changing the localhost url to a simple nginx webserver w/ the contents of the above webroot.

Resources