Visual Studio Solution with Two Projects Hosted on Azure - angularjs

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.

Related

How to Host my ASP .NET MVC Application with database?

I really need help or any kind of explanation about my problem.
I have a project built in Microsoft Visual Studio 2019. Its a ASP.NET MVC Application, and I have another project which enables me to create a database in my ("localDb")/ProjectsV13.
My approach was "Database-First", and created Model.espx automatically, and everything works fine (Used Entity Framework).
But now when I'm done making it, I need to PUBLISH It or HOST it. I don't understand the difference between that 2 terms.
I've been searching for solution for a quite a while, and still no solution.
I need to post in on CPanel.
How can someone use my app online?
How can someone see the same data as me?. Because I use localDb.
For example, I have login page for admin (just want someone to login with username:"Admin" and pw: "admin") and use my app.
I published it using FileSystem and managed to start my app with localhost. But that's not what I need
Thank you in advance!

Azure Clickonce publishing

we are working on a WPF application which we want to publish as a click once smart client application.
We are able to publish the application on local machine using Visual Studio 2012 and configured it in IIS.
Now we want to upload the published smart client installer to windows Azure Virtual Machine with Windows Server 2012 and IIS 8. We cannot upload the locally published components as the URL configuration in the manifest and deployment file is that of local server. We tried to edit the entries using text editor but once we do the editing the files become unused and it shows xml parsing error when we try to install from the location.
we tried to publish the application direct to the Virtual Machine but it shows an error as Front Page Extension is needed in IIS. We tried to find Front Page extension but couldn't find an version for IIS 8 in Windows Server 2012.
Can any one help us to publish the application in Azure Virtual Machine.
The problem you are having has nothing to do with Azure per se.
In the first case (of editing the XML files), you can do that but it's best to use MageUI to do the edit, because you can then re-sign the manifests. If you just edit the files, it messes up the security on them, and they will not work (as you have found). If you want to edit them with a text editor, you can do that, but then you must re-sign them (using mage); you can create a script to change the installation URL.
Or you can use MageUI. You need to do it in this order:
Open the application manifest in the versioned folder and then save it, re-signing it with your signing certificate.
Open the deployment manifest (yourapp.application) in the top deployment folder. Change the Start Folder to be the right Installation URL. Go to the "Application Reference" tab and re-select the application manifest in the versioned folder. (I know, it hasn't changed, but trust me, you have to do this.) Save this manifest and sign it with your signing certificate.
Copy the deployment manifest from the top folder to the versioned folder. It's always good to keep a copy, so you can go backwards a version if you need to.
NOW you can copy the files to your VM and they will work fine.
In the second case, the Front Page Extensions are required if you are using HTTP to publish the application, yet they are no longer available past about Windows Server 2008(?). So don't use HTTP. Use FTP. Set the publish file location using FTP, like ftp://myserver.mycompany.com/myfolder and set the Installation URL to the HTTP equivalent of it. Then publish it. It will put the files on your VM (assuming FTP is enabled on both sides), and the HTTP link should work.
By the way, you can also host your deployment in Azure blob storage. It is dirt cheap, and you can use something like Cerebrata Cloud Storage Studio or even write your own code to publish it (which I did). This article explains how to put the files out there, what the MIME types need to be, etc. If you do this, then it will work even if you need to replace your VM or redeploy it or the VM becomes unavailable for some reason.
here is a reference to Avkash Chauhan's blog post explaining in detail How to deploy ClickOnce Application using Windows Azure Storage in very simple steps?
http://blogs.msdn.com/b/avkashchauhan/archive/2011/05/09/how-to-deploy-clickonce-application-using-windows-azure-storage-in-very-simple-steps.aspx
He also gives an code example of a windows form (using Wpf) that he shows how to deploy on azure using one click deployment.
hope this helps

DNN / WebMatrix / Localhost / Multiple Sites

It seems that DNN is undergoing an upgrade and I cannot access the forums or many of the docs. Needing an answer soon, and Google providing too many varied types of hits (none of which are helpful or most of which post to the DNN site that is undergoing that upgrade), I had a few questions about setting up DNN.
First, I am coming from Orchard. There I was able to use Webmatrix - I downloaded the web version, opened as administrator, created modules, messed with themes, etc. Using the Orchard Docs, I was able to set up a multi-tenant site and run it on local host (IIS express through Webmatrix) - this included modifying the host/config files to view the multi-tenant sites. I could then publish to my own server running IIS 7. On the server I set up the landlord site then bound the tenants with no problem.
Being new to DNN (and things not being readily available at the moment on their site), I was hoping I could get some guidance on how to set up DNN similar to what I did with Orchard.
First question is obviously whether or not that is possible (i.e., no IIS, only IIS Express (Webmatrix) on my local machine).
Here would be my other questions:
If I can run it locally, can I just download the 7.1.0 new install package, and open Webmatrix (as Admin) on the folder I unzipped it in?
Assuming I just "Run" the website, I will then set up the "Landlord" instance of DNN on the following screens, correct? (i.e., where it asks for credentials and what DB setup I can use)
Can I then go ahead and create sub-tenant sites (alias/portal)? If so, do I go about manually updating my host/config files to run those tenants (depending on the port)?
Assume all of the above is correct, do I have to "reinstall" the 7.1.0 package on my webserver, or will a simple publish from Webmatrix do (with the proper credentials in Settings)? If so, I can handle pointing to the landlord on my server and then binding my subtenants in IIS.
Sorry for the n00b questions. Thanks!
On the Download page on dnnsoftware.com, there's a link to click which will start the install process within WebMatrix: http://www.microsoft.com/web/gallery/install.aspx?appsxml=www.microsoft.com%2fweb%2fwebpi%2f2.0%2fWebApplicationList.xml&appid=106
When you create a new portal, you can specify that it uses a URL which is a subdirectory of the current URL (i.e. a child portal alias), so that you don't have to use different ports. I'm not especially familiar with IIS Express, so I would expect that you could point multiple ports to the site, and map those as different portal aliases, but not sure exactly how you could do that, if you don't want to make use of child portal aliases.
To publish a site, you should just need to push the file system and database, and setup IIS.

"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

Website hostoed on IIS 7 displays zero results from stored procedure query

I have a WCF REST service running on IIS on port 8000. I have implemented two GET methods in the service. I created another web application project to implement the UI for the GET's. This application is also hosted on the same IIS on port 8080.
The GET methods call a stored proc from a SQL server db, also hosted on the same machine as IIS (this is a prototype).
From my VS 2010 environment, I am able to display the results from the db on the UI (using GridView and ObjectDatasource as the GET methods from the referenced WCF project). However, when both projects are hosted on IIS on different ports, the UI shows the column headers but not the results. I have checked the connection string for the projects and dont see an issue there.
Any suggestions?
First, I know you say you have checked it, but make sure you check the connection strings in the actual IIS directories. If they have been edited, publishing your site may no overwrite them.
Filing that, you may wish to attach to the IIS process to see what is going on. See How to debug a deployed web site.

Resources