How can I host Office add-ins on localhost? - windows

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.

Related

Azure Web Site not updating via Visual Studio Web Deploy

This may be a basic question, but I've searched for a little while and couldn't find anything specific to this.
I bought a domain and created the web app in Azure for hosting, and set up the DNS so that it's linked to the Azure Web App. Using Visual Studio 15, I opened the website via the FTP connection settings found in Azure, and was able to create files, edit the html, css, etc. Going forward, I wanted to use Web Deploy with Visual Studio to push new builds of the code up to the web site. I downloaded the publish profile from Azure, and imported it into a new visual studio project. I also copied all the previous files over(it wasn't alot). I got the correct Web Deploy settings and successfully published the solution to the Web App in Azure. However, it never updates the code with my new changes. When I look at the site in Firebug it still has the same files/code that it had when I edited it via FTP.
Any idea what I'm doing wrong?
I followed your steps and everything published perfectly for me. Did you try to simply refresh the file list to make sure Visual Studio is seeing all your files? Are they included in your project?
Also, when you go to publish, on the 4th step labeled preview, try to hit "start preview" and see if it detects any changes.
Also, could you tell me a bit more about your project? Is it a website project folder, mvc solution, etc?
You could try to clean the website to make sure your new files are getting deployed.
Clean Windows Azure Website

Deploying to FTP/Web Deploy In Visual Studio 2015

I cannot figure out a way to publish a web project in Visual Studio 2015 CTP using web deploy or FTP. In the Publish wizard, there are only options for Azure, Import and File System. In Visual Studio 2013, there is a Custom option where you can specify the connection settings and choose between Web Deploy, Web Deploy Package, FTP and Filesystem.
I tried moving over the publish profile from my Visual Studio 2013 project by putting it in the Properties-->PublishProfiles folder, and then it behaved like Visual Studio 2013, but would not publish (failed to connect to remote host) with the same settings that publish fine in 2013.
Any ideas?
It sounds like Web Deploy 3.6 beta supports the new content models in ASP.NET 5 (ASP.NET vNext) and I guess that the VS 2015 Web-Deploy client doesn't support it yet. (28 April 2015)
This blog post gives some command-line options for using a publish profile. I'm in a new environment that isn't set up for web-deploy yet, so I haven't tried it myself. (I did a file-system publish to test against my local IIS.)
I also experienced the same issue. It seems that, at the time of writing, the FTP publish target isn’t available yet: I guess that’s most likely because the Web Development Tools are still in release candidate / preview phase, so the GUI still has some missing features.
Luckily enough the issue can be easily solved with the following workaround.
If you don't see the FTP option, choose File System instead and go ahead. When prompted for a Target Location, insert the FTP Server URL and go ahead.
The remaining steps won’t change, so you can complete the wizard that will be saved into a ProfileName.pubxml file.
Once done, open that file and apply the following changes:
Locate the <WebPublishMethod> element and change its value from FileSystem to FTP.
Locate the <UsePowerShell> element and entirely remove it.
Right after doing that, right-click to the project’s root node, select Publish and re-open your Publish Profile via the Publish Profile Wizard in edit mode: all the FTP options (Server, Site Path, Passive Mode, Username, Password) will now be available.

Is it possible to develop a classic ASP website directly on a webserver with TFS?

We currently have a very large Classic ASP website that is critical to our business. It is kept in Visual SourceSafe for version control and we have numerous developers who develop the site in Visual Studio 2005. We open the website with VS2005 directly from the Development web server. We can check the files in and out of VSS directly through VS2005 and all changes we make to the asp pages are visible on the development website immediately, without the need to check back in or copy any files.
We would like to move forward with VS2013 and TFS. Our newer websites are all in TFS and we want to standardize.
Is there a way that we can continue developing the website directly on the web server using VS2013 integrated with TFS? I have found number of articles and responses online about TFS and ASP.NET, but since we don't build classic ASP code, these don't seem to help us.
Really your development server is not where you should be doing your development, but on your local desktops, and then deploying to your development server for initial testing.
However with that said, it looks like your working directory in SourceSafe is where you have IIS pointing to on your development server. You can do the same thing with visual studio and TFS. Just have your Visual Studio workspace pointing to the same location, but checking in everything to TFS.
Edit- the bin directory for a project typically doesn't get checked in to TFS. The developer would have to make sure they build the project every time they wish to view the site on this development server to populate the bin directory.

Visual Studio 2010 change from localhost to full computer name/domain

I am using Visual Studio 2010 and I would like change debugging environment from the localhost to my full computer name/domain. Does anyone have some step by step instructions on how to do this? (I would also like to set it up as the default for all new projects plus how to change it in existing projects). I am new to using visual studio and programming in general.
I found this post Visual Studio 2010 - Change localhost to custom domain in the forum but it wasn't clear to me on how to make the change. I went to the project properties web tab and attempted to set up local IIS Web server but got the following error:
"ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly."
I am not ever sure if that was the correct way of going about doing this. I just need my debug url address to go from:
"http://localhost:53674/Projectname.aspx"
to:
"http://computername.pag-domain.webname.org/Projectname.aspx"
Thanks!
For fixing the iis web server, I am not really sure what was done...our IT department worked on that. For setting up the local IIS webserver in visual studio I did the following: In the web project properties, under the web tab, I choose "Use Local IIS Web server, in the project URL, I put the full computer domain and told it to create a virtual directory.
Got it. Our IT came to the rescue — he fixed some issues with the ASP.NET not accessing 4.0 correctly. Then I set up the "Use Local IIS Web server" correctly and it worked like a charm.

Need to name websites on localhost running on different Ports

I have my development PC on Windows 7 for ASP.NET and running Visual Studio 2010 and IIS 7 (NOT using the development web server). I have created multiple websites on different ports on my PC. E.g. http://localhost:8080 points to Website A. But when I open the site in Visual Studio, the project name shows as http://localhost:8080, as follows.
I would like to change that name to http://WebsiteA or http://WebsiteA:8080. Some identification.
I edited hosts and added
127.0.0.1 WebsiteA
Ping works fine. Also browsing WebsiteA:8080 works fine. But when I try opening the site (http://websitea:8080) in Visual Studio, it says Web site does not have Frontpage server extensions installed.
Is there any way to at least rename what's shown in the project list in Visual studio. I just need an identification on each website. I have about a dozen project and more may be added.
Thanks
IIS in Windows 7 allows you to have named virtual hosts. You can use that to separate out your sites. Visual studio cooperates with the naming of the virtual hosts. You will need to configure your visual studio project to operate against IIS (for debugging and running) rather than the visual studio built in web server.
Managed to find a way. This is what I did. Went to IIS Management, Created a new Website - Give it a name WebsiteA, Choose the folder where the web is located and give it a Host Name - WebsiteA. Click OK
Then go to Application Pools. You'll see your Host name there. Change the ASP.Net version to 4.0 or whatever you want. Then add a hosts entry 127.0.0.1 WebsiteA.
Now you can add http://WebsiteA in Visual Studio.
Thanks for all the help guys

Resources