Azure .Net WebApp Deployment Failed but it works locally on VS - asp.net

I am new to .Net and Unable to understand some weird behaviour with Azure.
I am trying to publish a .Net Project to Azure Web App. And It is throwing very silly errors. I assume thats becoz of new C# version.
Here is the log file.
Use Case 1: When trying to build from Visual Studio Team Services and then deploy using Continuous delivery Works.
Use Case 2: When trying to publish directly using Visual Studio using App Service profile and it works.
Use Case 3: When trying to deploy through repository that is hosted at Visual Studio Team Services. And it fails and thats the error.
Any lead will be helpful.
Do let me know, if the information provided is not enough.

To compile C# 7.0 code, we need msbuild 15 installed. Currently, msbuild15 is not enabled on Azure Web App.
For Use Case 1 and 2, the C#(7.0) code is build on your development side on which
Visual Studio 2017(msbuild 15) is installed.
For Use Case 3, the code will be complied on Azure Web App, so it will throw errors.
Microsoft engineers are in the process of building these tools for Azure, they should be out soon. you could stay updated on github

Related

Azure App Service Deployment Centre fails to deploy from GitHub repo

I had an issue where I am developing a web service in Visual Studio 2017, ASP.NET with .NET version 4.7. When publishing to Azure from Visual Studio, it published fine and ran fine, it also runs in debug with no problems.
However, when I linked up the GitHub repo to the Azure App Service and pushed the updates to GitHub, then syncing Azure and waiting for it to pick up the updates and then deploy the app using Kudu, it would sync but then give multiple syntax errors along the lines of ';' expected, '(' expected, etc when attempting to deploy, and would therefore fail.
Apparently this is due to Azure using MSBuild 14, when it should be using MSBuild 15 for my VS2017 project. I don't understand the intricacies, and can't find many references to this issue online, but the issue was resolved by adding the Microsoft.Net.Compiler NuGet package to the project and then pushing this to GitHub and syncing the repo within Azure Deployment Centre.

Azure Web App with assembly containing C++/CLI

I have some existing functionality in unmanaged C++ which I wanted to use in a Web App. This code was already wrapped in C++/CLI and used via desktop C# apps. So there is already an existing mixed mode .NET assembly containing the functionality I want to use in a Web App. I also already have Azure hosted web apps that are composed of assemblies containing only C# and I can publish them from Visual Studio 2017 to an Azure App service with no problem.
So I tried to add the mixed mode assembly and started getting errors from the publish about the dependencies of the mixed mode assembly. The only dependency of the mixed mode assembly is on the VC++ runtime so I assumed that was the problem. To prove this I created an Azure VM started IIS on it and published to that and got exactly the same error. I then installed the VS 2017 C++ runtimes on the VM and published again. The error went away and the Web site works fine.
I them logged onto the machine hosting the Web service using Kudu and it appears to have the VS 2017 C++ run time already installed. So I am baffled why I get the error when I publish to it. I have tried adding the runtime DLL's like vcruntime140.dll to my publish but this didn't fix things. I also tried re-installing the runtimes with no luck.
So does anyone have any insights as to why I am getting DLL dependency errors and what I can do to fix it. Ideally I was hoping for a Hello World example of using C++/CLI in a Web App from Microsoft but have not been able to find one.
Note there is a similar question here multi-file c++/cli .net assembly in ASP.NET web site without an answer.

Visual Studio - deploy existing website/webAPI to Azure

In my VS(2015) solution, I have a ASP.Net website and a WebAPI project. For normal development, I want to use IIS on local machine for dev/test. However, I also want the option to be able to deploy the same sites to Azure on demand.
I know I can 'Convert' an existing project to Azure project from VS. But then it'll become a cloud project only. I don't want to convert it to cloud project.
Is there a way I can use my existing projects in VS and deploy/publish them to Azure?
Thanks
You don't need to "convert" your project to an Azure project, you can simply create a publishing profile in Visual Studio and push the build to Azure.
The Microsoft documentation explains how to do this, follow the steps from the "Publish to Azure" section onwards.

Publish scripts not generated by visual studio

I am trying to figure out how to best deploy my web apps to azure using something like Jenkins. So I thought i should investigate publishing using deploy scripts.
In all tutorials on deploy scripts for azure you should start with some scripts generated by visual studio when creating your web app. This doesn't seem to happen for me. Am I missing something or is that just not true anymore?
I am using Visual Studio 2015 and I am building ASP.Net web apps.
According to the tutorials I am supposed to get a folder on solution level called "PublishScripts".

Deploy from Visual Studio 2010 stopped working after upgrade to Web Deployment Tool 2.1

I have a web site project that has been existing for a while - it has been ASP.NET MVC2 based up until right now. .Net 4, Visual Studio 2010 Sp1, deployed to IIS 7.5 running on Win2008 R2.
I have four separate deployment profiles - "alpha", "test", "staging" and "live". Yes, I could probably have come up with better names, but they should hopefully convey what they are for.
It was recently decided to upgrade to MVC3 to take advantage of new awesomeness like Razor, global filter attributes, and start using NuGet etc. So I went on an upgrade binge with the Web Platform Installer. One of the things I updated was the Web Deployment Tool - both my developer machine (where the MVC3 upgrade happens) and the web server got this new version of the tool installed.
Since then, I have not been able to do deployments. I have gone back to earlier versions of my project (thanks to git for allowing me to painlessly go back to any previous version) and tried to deploy them, and they don't work either.
Whenever I try to do a deployment from Visual Studio I get the following error:
Web deployment task failed.((23.05.2011 11:18:24) An error occurred when the request was processed on the remote computer.)
(23.05.2011 11:18:24) An error occurred when the request was processed on the remote computer.
Unable to cast object of type 'Microsoft.Web.Deployment.DeploymentSyncOptions' to type 'Microsoft.Web.Deployment.DeploymentSyncOptions'.
I can see why that cast would be hard. ;)
But seriously - how can we get deployment from Visual Studio to work again? In the future we will do this using our CI server, and install a deployment package using MsBuild automatically on the correct web server depending on the git branch that was updated, but that is some time in the future.
I have full access to both machines so any other information need can hopefully be gathered.
You might be having beta version of web deploy on your box if you have ever installed web platform installer v2 beta. YOu can check that by
gacutil -l Microsoft.web.deployment.
If you see any 7.5.0.0 version then you have a beta version. Uninstall this version. You need to check and change this on both the client as well as the server.
Owais is right - this is very likely because you have a pre-release version installed. Rune can you please check and let me know?

Resources