Nuget 3.0 error on azure deployment - azure

I have a VS2015 project that I have successfully deployed on Azure (via Github) as a web app.
However, after some offline updates, when I deploy, i get the error
The 'System.Net.Http 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60717.93'."
Is nuget 3.0 installed on the web app servers? And how can I use it?

I ended up reverting the System.Net.Http 4.0.0 package to an older version, that works with NuGet version 2.8.60717.93.

NuGet doesn't go on the the app server, it goes on the build server. Make sure your build server has the latest NuGet client. See this SO Answer.

Related

Build works locally and fails in Azure

I have a project in C Sharp which build correctly in my local machine ( as well as in the one from my colleagues ). But when we try to configure the pipeline in Azure, in the step of Nuget restore everything stops and we get an error message stating that package "A" is not compatible with netcore 2.2, as well as package B,C,D,etc.
Why is it possible to see this error in Azure but not in my local? The project is setup to use netcore 2.2 and builds fine in my local machine.
Why is it possible to see this error in Azure but not in my local? The project is setup to use netcore 2.2 and builds fine in my local machine.
This error can occur with an outdated version of nuget. The default version of NuGet running in the VSTS pipeline was not the latest one.
So, to resolve this issue, there is a nuget version installer task which you can run as part of your build step to upgrade the version of nuget running in your build pipeline:
Besides, if update nuget version not resolve this issue, please check the SDK version on the build agent is same as your local, you can use the task Use .NET Core to update the SDK version.
Hope this helps.

Cannot install Microsoft.Azure.ServiceBus using NuGet

I'm running a test .Net Core Console app to try using ServiceBus messages. However after using Nuget to install Microsoft.Azure.ServiceBus v3.1.1 I get the following error
Package Microsoft.Azure.ServiceBus 3.1.1 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Azure.ServiceBus 3.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
I've tried installing up to v3.3.0 and get the same, I'm using the latest .Net framework and have updated my VS2017 so I don't know what the problem can be. Has anyone else had this issue?
I don't know what the problem can be
No matter the version of package Microsoft.Azure.ServiceBus is v3.1.1 or v3.3.0, both of their Dependencies is .NETStandard 2.0 while your app is .NetStandard 1.0. So, as Peter said, the version of .net core you have is too old.
You could go to download the latest .Net Core SDK and then reinstall the package you want.
Or you could download the Microsoft.Azure.ServiceBus v1.0.0. However, because the version is too old, some feature may not have. So, I suggest that you could update your TargetFramework to .net core 2.0+.
Your console app needs to have a TargetFramework .net core 2.0+ (Check in .csproj file), download latest .NET Core SDK and create a new .Net core console app to install the package again.

ASP.NET Core app build to target Core 2.1 fails on IIS 10 server where Core 2.1 is installed

I have just setup up IIS 10 on a clean Server 2016 hosted server, and installed the following packages that I have gleaned should be on the machine to allow IIS to host ASP.NET Core applications:
aspnetcore-runtime-2.1.0-win-x64.exe
dotnet-hosting-2.1.0-win.exe
dotnet-runtime-2.1.0-win-x64.exe
I have installed my app straight into the Default Web Site and replaced all files in C:\inetpub\wwwroot\ with my app files. I also did assign the web site an app pool with no managed code, so that isn't my problem.
Last time my app was built with 2.0, and I installed the latest versions of the above packages, which I'm sure was 2.0, and the only error I had was that the command dotnet that IIS uses to invoke Kestrel to run the site, was not in the PATH env. variable
Now when I try and browse to localhost on the Server 2016 machine, it gives me the following error, found in the Windows event log:
Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE' with physical
root 'C:\inetpub\wwwroot\' failed to start process with commandline
'dotnet .\QuickDrive.Mvc.dll', ErrorCode = '0x80004005 : 8000808c.
Initially I tried with the same build as before, which was 2.0, and when I got this error, I rebuilt the app to target 2.1. Nearly every search result and relevant SO answer I can find suggest a version conflict, but now there should at least be no version conflict between the runtime and hosting package on the server. Maybe there are other version conflicts I am not aware of though?
At very least I'm asking for some advice on how to get more detailed diagnostic information, even if I don't get an answer that tells me straight what config options and versions to check on Windows and on IIS.
You have to install the Core SDK for whatever version you want to target in Visual Studio. Installing the runtime alone won't do the trick. You may have the restart Visual Studio afterward to see it in the list.
Here is a link to the SDK 2.1 download (the latest as of this writing).
I solved the problem by running dotnet myWesite.dll in PowerShell, and first I found that dotnet.exe was not in the PATH environment variable, and after fixing that, running dotnet myWesite.dll again gave me a meaningful error message that an assembly was missing because it had not been included when I published the website.
I faced the same error on the dev machine in IIS Express. MVC App stopped working all of the sudden. Eventlog gave the 0x80004005 error code.
After trying multiple suggestions, the solution to debug the wired error code was to run the app in the console:
[Project bin folder]> dotnet [projectname].dll
It appeared that during the NuGet package update, the dotnet core version was accidentally updated to 2.1.4 where as the installed version was 2.1.3
[could be a bug in Nuget manager as the update was from there]
I edited the project file to reference the available version (2.1.3) and the app started to work properly.

How to update .NET Core on Azure Web App?

I have my Azure Web App configured to deploy from a local git repository - I just push my changes to the Web App git repo and it builds and deploys the site.
I just updated to my ASP .NET Core site to: "version": "1.0.0-preview2-003133", previously it was 003131 which worked no problems.
I now get the response when doing the git push:
remote: GETSDKTOOLINGINFO : error : The project is configured to use .NET Core SDK version 1.0.0-preview2-003133 which is not installed or cannot be found under the path D:\Program Files (x86)\dotnet. These components are required to build and run this project. Download the version of .NET Core SDK specified in global.json or update the SDK version in global.json to the version that is installed.
I would prefer to update the .NET Core version on my Web App than downgrade, but how?
In case you are wonder how I have 3133 already: https://github.com/aspnet/Tooling/issues/801
You basically can not update the dotnet version on Azure. Currently the version of dotnet that is running is 003131. So you still have to use the previous version.
How are you building your release package?
I had this yesterday using a VSTS build process, when using the 'Visual Studio' build task it will fail with this error currently - changing your process to use the "CMD line" build task and "dotnet publish" allows the build to complete successfully.

'Microsoft.WindowsAzure.Storage' version issue in Mobile Service

My Mobile Service worked great till I install 'Microsoft.WindowsAzure.Storage': 4.3.0.0 through NuGet from Visual Studio.
After the installation of it, Mobile Services shows
Error
Found conflicts between different versions of the same dependent assembly 'Microsoft.WindowsAzure.Storage': 4.3.0.0. Please change your project to use version '3.1.0.1' which is the one currently supported by the hosting environment.
Does Mobile Service only support 3.1.0.1 not the latest one? Or any other configuration I can modify to make it work?
much appreciated for your response.
Oh, there's already a solution and I verified correct.
http://blogs.msdn.com/b/jpsanders/archive/2014/10/10/azure-mobile-services-net-backend-found-conflicts-between-different-versions-of-the-same-dependent-assembly.aspx
backup your project.
find a clean packages.config
copy content from it and replace to my existing problematic packages.config
open the package manager console and type: Install-Package WindowsAzure.Storage -Version 3.1.0.1
Clean the Build. Then Build
Publish again to Azure Mobile Services.
done.
Bottomline: if you want to use Mobile Services, PLEASE DO NOT USE NuGet to install latest WindowsAzure.Storage cause Azure Mobile Services currently doesn't support the latest Storage client which is very weird.
I had the same problem when working on an Azure Mobile Service project (.NET Backend). However, I could not downgrade to Azure.Storage 3.1.0.1 because it requires Ms.Data.OData; 5.6.0 (exact version). Even having the assemblyBinding which redirects all versions to MS.Data.OData to 5.6.2, still did not work.
At the end, I had to uninstall almost all Nuget packages, including Azure.MobileServices.Tables, .BackEnd, and .Enitity. This removed almost all Nuget packages. After that, I was able to install WindowsAzure.Storage 3.1.0.1
Install-Package WindowsAzure.Storage -Version 3.1.0.1
Then reinstalling all the packages that I removed earlier (Azure.MobileServices.Tables, .Backend, etc). This worked for me. Hope it helps somebody else too

Resources