Iam trying to deploy a dotNet app in Azure App Service, but it doesn't work because the default version of msbuild is at 14:
D:\home\site\wwwroot>msbuild /version
Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.
14.0.23107.0
I've tried to modify the deploy.cmd with the msbuild 15 path but it doesn't work. How can i simply update the default msbuild version to be at 15 ?
thanks
This has been discussed here: https://github.com/projectkudu/kudu/issues/2350
D:\home>set msbuild
MSBUILD_15_DIR=D:\Program Files (x86)\MSBuild-15.3.409.57025\MSBuild\15.0\Bin
MSBUILD_PATH=D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe
To use it you will need to have a custom deployment script with at least these two modification:
pass the msbuild15.3 directory to nuget (nuget4 has dependency on it):
nuget.exe restore "{your .sln file path}" -MSBuildPath "%MSBUILD_15_DIR%"
use msbuild15.3 to build and publish:
"%MSBUILD_15_DIR%\MSBuild.exe {your build arguments}"
Having mentioned that, Azure manages OS patching on two levels, the physical servers and the guest virtual machines (VMs) that run the App Service resources. Both are updated monthly, which aligns to the monthly Patch Tuesday schedule. These updates are applied automatically, in a way that guarantees the high-availability SLA of Azure services.
While critical OS information is locked down from access (see Operating system functionality on Azure App Service), the Kudu console enables you to query your App Service instance regarding the OS version and runtime versions.
Kindly checkout the document OS and runtime patching in Azure App Service for more details on this topic.
Related
We have for a while been building various web projects with AzureDevops and self hosted build agents.
Today I had to add a new build, consisting of a windows service written in .net core 3.1. This service has to be installed by our customers, so we have to provide it in a friendly installable way. As some of our developers were already used to handle MSI/*.vdproj projects, they added a vdproj into the *.sln to manage that. On a developper machine, this is not a problem even with VS2019: you just have to use the relevant VS studio extension...
But when it comes to building that in a CI/CD context, this becomes a real challenge. I quickly understood that we can't use MSBuild at all for that and found some alternative using directly Visual Studio (devenv)... Inspired by this thread (still opened), I came up with the following command line:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv" [...]\MySolution.sln /build "Release" /Project MyInstallationProject
This worked fine both on my developer machine and even on the build agent machine. But when I add it into a build pipeline as a command line task, it seems to hang, and after a while I get the following result for the job:
##[error]The job running on agent <MyAgent> ran longer than the maximum time of 60 minutes. For more information, see https://go.microsoft.com/fwlink/?linkid=2077134
What can I do to make it work?
What are the best practices for generating a self installable in a CI/CD context? (Is MSI still relevant? )
As a workaround, you can try to install the extension Build VS Installer and use the task DutchWorkz - Build VS Installer(s) to build Visual Studio Installer Project in Azure Pipelines.
Here are some tickets(ticket1, ticket2) with similar issue you can refer to.
When i deploy the application from Visual Studio to Azure app service using Framework/Runtime dependent mode, then app service run properly.
But when application is deployed using CICD (using VSTS), then app service fails with above mentioned error in title and following error is logged in stdout log files :
Error:
An assembly specified in the application dependencies manifest (App.deps.json) was not found:
package: 'System.Diagnostics.PerformanceCounter', version: '4.5.0'
path: 'runtimes/win/lib/netcoreapp2.0/System.Diagnostics.PerformanceCounter.dll'
But the dll is present in mentioned path under .netcoreapp2.0.
I am publishing the application using VSTS agent.
If i restart the app service then it works fine.
This is one of those errors that can come up for a thousand unrelated reasons. -Everytime- I get this error it's because I've upgraded Nuget packages in my project and one of those packages uses a version of the .Net Core SDK I haven't installed locally. I suspect since you're using the Framework dependent mode it could be an issue if it sandboxes you away from other SDK's (not sure if it does, just thinking out loud).
Make sure your .Net Core SDK's are up to date.
Try publishing it and sending the whole framework with it if you're using .Net Core as the backend (and not the old framework).
Check your NuGet's and make sure they're all supported on the framework you're specifying. I've seen cases where a 4.5 framework assembly 'might' work locally but then error out on the server. If one of them targets an SDK that isn't on the server you'll get this.
https://www.blakepell.com/asp-net-core-http-error-502-5-ancm-out-of-process-startup-failure
Since it works fine when you restart the app service, you could add a Azure App Service manage task to restart Azure App Service in your pipeline:
steps:
- task: AzureAppServiceManage#0
displayName: 'Restart Azure App Service'
inputs:
azureSubscription: azureSubscriptionName
Action: 'Restart Azure App Service'
WebAppName: AppServiceName
It seems that the first time you try to run, your application can not find this .dll that is required on the server. What you can do is to add this in your .csproj file:
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
Adding the above snippet will export all DLLs needed to run the application (assuming SDK is not available, and runtime is quite lightweight to contain non essential libraries).
I installed Visual Studio 2017.
I wanted to clone a repository and try in my local system.
Suppose i want to clone this. repo (Not mine.) Is it possible in one step?
Or else do i need to write step by step actions and necessary codes to run the project?
By checking NuGut package manager to auto download packages on build time will
work? I am new in ASP.Net. Is there any way to run the project in local system by just cloning.
EDIT:- Tried to restore packages
PM> dotnet restore
Welcome to .NET Core!
---------------------
Learn more about .NET Core: https://aka.ms/dotnet-docs
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
Telemetry
---------
The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't in
clude command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telem
etry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). For establishing trust on other
platforms refer to the platform specific documentation.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
C:\Users\win7.system3\Documents\Visual Studio 2013\Projects\localhost_54920\localhost_54920.sln : Solution file error MS
B4249: Unable to build website project "SAMP". The ASP.NET compiler is only available on the .NET Framework version of MS
Build.
First of all, you'll need .NET Framework 4.6.1 installed in your machine.
Short answer
Having that installed, you should be able to open the project/solution with Visual Studio, build it* and run it from there.
Long answer
If that was a .NET Core project, without Visual Studio it would be as easy as:
git clone https://github.com/sarn1/example-aspnet-mvc
cd example-aspnet-mvc\ComicBookGallery
dotnet run
dotnet run will restore (dotnet restore) the dependencies, build (dotnet build) the project and run it.
However, that's not the case, so you can only:
Restore the nuget packages using Visual Studio or nuget.exe cli.
Compile it* using or msbuild (use Developer Command Prompt for Visual Studio to be able to easily access it).
Run it... from Visual Studio, which makes the rest of the process kind of worthless.
git clone https://github.com/sarn1/example-aspnet-mvc
cd example-aspnet-mvc
nuget.exe restore
msbuild /t:build
* You may need to apply these changes to make the project compile.
In the CodeShip Pro documentation, the recommendation for doing Continuous Deployment to Digital Ocean involves encrypting an SSH private key, and storing that in your repository. To do this, you need to install jet on your machine. Unfortunately, jet is not available on my platform (Win 10 64-bit).
In every CodeShip project, there's an SSH key generated by CodeShip, and controlled by them. The documentation doesn't describe how to use that SSH key in a CodeShip Pro setup. Is there a way to do so? Or is it only available in CodeShip Basic projects?
I'm trying to get a .NET Core 1.1 project built, copied, and deployed, with external system package dependencies. The commands involved include a big pile of apt-get work for setup, dotnet restore, dotnet build, maybe a dotnet publish, and an scp step for the deploy itself.
I am running Visual Studio for Mac and I am truing to deploy my ASP.NET Core App to my Google App Engine project. I followed the steps described in this official guide but I got stuck in the "Install Cloud Tools for Visual Studio" step as there's no extension for Visual Studio Mac version.
I also came across the Cloud SDK for Mac and now I am confused which way to go. What's the relationship between these two guides and what's the right way of deploying a VS ASP project to App Engine on a Mac?
EDIT
app.yaml file contains:
runtime: aspnetcore
env: flex
Steps to deploy to Google App Engine:
Create a new ASP .Net project in Visual Studio
Build your project.
Install Google Cloud SDK: https://cloud.google.com/sdk/.
You’ll have to configure gcloud for your Google Cloud Platform project.
See: https://cloud.google.com/sdk/docs/quickstart-macos.
Run the following commands via terminal while in the same directory as your VS solution file:
gcloud app create
dotnet restore
dotnet publish -c Debug
Create an app.yaml file as follows and place it in the “publish” directory.
The contents of the app.yaml file are:
runtime: aspnetcore
env: flex
The path to the publish directory will be as follows: ".../my_vs_project/bin/Debug/netcoreapp2.0/publish"
Run the following command via terminal while in the same directory as app.yaml file:
gcloud app deploy
Well, the SDK is a lower level tool to use and hence more cumbersome. Basically what "Cloud Tools for Visual Studio" does is hiding the complexities of using SDK. Since there is no GCP extention for VS Mac looks like that's the only choice that you have so you need to do SDK commands like " gcloud app create" and "gcloud app deploy" to deploy your project to GCP. I hope this is helpful.
Note: the comment on another answer indicates that the confusion comes from also looking at the Google App Engine .NET Flexible Environment Documentation.
In general GAE is higher level cloud offering which can take care of some of the maintenance activities a plain, general-purpose VM infra like GCE would require (for example scalability), so you can focus more on your app itself instead.
But the choice of using GAE or GCE is really yours - it depends on how you want to build and use your app. And maybe on how well these are supported/integrated with your tools of choice (VS in your case).