Publishing WebAPI to api folder of an angular application on IIS gives 500 errors on request. - angularjs

I'm developing an angular application with a webAPI 2 backend. I'm developing them entirely independently (in different repositories, different directories, etc. The angular project isn't a visual studio project at all. I'm using WebStorm for it).
Both the front and the backend are working great when debugging, but I can't figure out how to get the backend to work when deploying. I deployed it to <application>/api and I put the angular application in <application>.
However, whenever I go to <application.com>/api, I get a 500 error. I also get a 500 whenever I call it from the angular app.
In IIS, I created a Website where the application lives. I clicked on the api folder and converted it to an Application. Is there anything else I need to be doing?

I ended up having to follow this post to fix it.
Click "Start button"
in the search box, enter "Turn windows features on or off"
in the features window, Click: "Internet Information Services"
Click: "World Wide Web Services"
Click: "Application Development Features"
Check (enable) the features. I checked all but CGI.
IIS - this configuration section cannot be used at this path (configuration locking?)

Related

Problems testing Office Add-In with an already Existing Web API project

I have a Web API service that is tested and working well. In a separate project I have an Outlook Web Add-In. The UI is working just fine. Now, I would like to make calls to the Web Service I've created.
The Web API project launches IIS (using SSL)
I've copied (copy/paste) the Office Add-In folders to what would be the root folder ... (at least I think I have the web root folder)
After launching the Web Service from Visual Studio, I run OWA and side load my Add-in. The right Icon appears. When I click on one of the commands in the drop down, nothing happens. Chrome's debugger doesn't show any messages that would indicate that my Add-in has been called. No errors.

Visual Studio Solution with Two Projects Hosted on Azure

This is the first website that I am trying to publish to make live and rather lost on how exactly I should go about it. I have a Solution in Visual Studio 2015 that is separated into two projects. My AngularJS front end is in one project and I have a web api back end that communicates with a SQL DB to fill http request from the front end. I have been testing to make sure that everything works by launching from visual studios and setting them to communicate with localhost:. Everything works fine when I do this.
I now want to host this project as an Azure web app. I have tried downloading the publish settings and hitting publish for each of the projects in visual studio. Visual Studio tells me that my solution has been successfully deployed, but when visiting the site, all I get is a "Server Error in '/' Application".
I do not really know how to go about doing this. Any help would be greatly appreciated.
The problem is that each time you're publishing your project to Azure it overrides previously deployed project. So if you're deploying you client project last it will override previously deployed API and vise versa.
There are several ways to do achieve what you want.
First is to have two Azure Web Apps, one for client and one for API. But it will lead to cross domain requests.
Or you can do like pre-deploy event on your side before publish which will combine your API and Client in one "project". There are also several ways you can do this. You can reference one project from another and build API and Client proejcts in one folder or have a pre-deploy event which will merge API and Client. Also, keep in mind that you will have to merge your web.config files. Also not the best way.
Or the best one. Just create a several virtual directories in your Azure Web App I would prefer this one.

How to Deploy Click Once Application in different Domains

I have built a C# WPF Application in Dot Net Framework 3.0 and published thru Click Once Application via localhost IIS in my system. My system placed in FileServer1 Domain and all the systems under FileServer1 can able to install the application. But we can not able to install it under different domain FileServer2.
While clicking the Install button, it will show that Installation file was missing. Please help me out how to proceed with this issue.
While publishing the file, I have given as http:\10.xxx.xx.xx instead of localhost. Now its working in all the domains.

How to have a SharePoint action invoke a feature in a WinForms application launched by Click-Once?

We have a SharePoint site that our users have open all the time (type of dashboard for the business). We have a WinForms application that listens on a specific port for when the user clicks a web part on the SharePoint site, we take the JSON in the WinForms, parse the request and launch a feature in the WinForms. Essentially allowing a web site to launch a feature in a running WinForms app on the same client machine.
This worked great when we were running in XP. When we moved to Windows 7 (with elevated UAC), this feature stopped working. Since we launch the WinForms app via ClickOnce, and ClickOnce apps can't be Run As Administrator, our current code won't work.
We can't make the ClickOnce app Run As Administrator for all the reasons you see here on StackOverflow.
So my question is: how can we invoke a feature in a ClickOnce deployed WinForms app when a user clicks on something in SharePoint site? It is super easy to get the WinForms app to call a Sharepoint web service but I need to go the otherway.
You can invoke a ClickOnce application by calling the deployment manifest URL. If you want to be able to call the app and have it do something specific, call the deployment manifest URL and pass query parameters to it, then have the application handle the query parameters.
This article shows you how to handle query parameters with ClickOnce applications.

"Calls to the web service will fail..." Once Again

Last year someone reported encountering this problem ("The Silverlight project you are about to debug uses web services. Calls to the web service will fail unless the silverlight project is hosted in and launched from the same web project that contains the web services.") and accepted the answer to "set the web project which hosts the Silverlight application to be your startup project."
I'm seeing the same message, but think the solution might have to be different. I am building in VS 2010 a Silverlight application to access the Google Weather API, with VB as the code-behind. The API will return a XML file with data for the specified city (ex., "http://www.google.com/ig/api?weather=london,england"). The Solution Explorer only shows my VB/Silverlight project ("GetWeather"), and the Project Properties dialog box shows the Startup Object as "GetWeather.App" -- the only choice. I'm trying to use a WebClient object to make the call and an XDocument object to parse the return. But I repeatedly get the above error message, with no other result. What am I doing wrong?
Thank you in advance!
I would add a simple Web project and configure it to host the Silverlight app. You'll need to host the app somewhere anyways, so why not create a stub ASP.NET application in your solution? The easiest way is to create a new Silverlight app solution selecting an ASP.NET web project as the host, and then copying your existing code to that solution. Then you should set the web project as the startup one. This should make debugging a lot easier.
Besides, do remember to configure the client access policy to enable cross-domain calls. Check out this article

Resources