After migrate .Net framework from 4.6.2 to 4.7.2, Azure Cloud Services is not working - azure-cloud-services

After I migrated .Net framework version from 4.6.2 to 4.7.2, there was no problem with I run locally. However, when I published to Azure Cloud Services, there should be something wrong so the service bus message moved to DeadLetter Queue. What's wrong is it as I chose osFamily to 6 (Windows Server 2019) already?
If I chose back Windows Server 2016, below error was out during starting the service:
Unhandled Exception: Method not found: ‘Void Microsoft.Azure.KeyVault.KeyVaultClient..ctor(AuthenticationCallback, System.Net.Http.DelegatingHandler[])‘. at Topo.SettingsContext.GetKeyVaultClient(ClientAssertionCertificate assertionCert) at ...
After that, I also tried below method to install .Net framework in WorkerRole manually but still failed:
https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-startup-tasks-common

The Net Framwork 4.7.2 is not installed by default on a cloud service.
You can follow this article to install it:
Install .NET on Azure Cloud Services roles
Basically you will need to:
Include the Net installer in your project.
Add a startup task to run the installer as part of the deployment.

Related

Unable to generate deps.json to enable migrations

I use Asp.net core mvc for web developing.
I want to enable entityframework migrations via Entity Framework Core .NET Command Line Tools:
dotnet ef migrations add InitialDatabase
but an error occurs:
unable to generate deps.json, it may have been already generated: C:\Program Files\dotnet\sdk\2.0.2\Sdks\Microsoft.NET.Sdk\build\GenerateDeps\GenerateDeps.proj
Are there any .NET Core configs that I missed?
When I add a service reference to a regular.net core web application, I got the similar error.
Error:Unable to generate deps.json, it may have been already
generated. You can specify the "-d" option before the tool name for
diagnostic output (for example, "dotnet -d ": C:\Program
Files\dotnet\sdk\2.1.502\Sdks\Microsoft.NET.Sdk\targets\GenerateDeps\GenerateDeps.proj
After the investigation I came to know that, somehow svcutil was not installed. Once I installed svcutil using Nuget Package Manager (Install-Package dotnet-svcutil), this issue resolved.
you need to install :
The Windows Communication Foundation (WCF) dotnet-svcutil tool is a
.NET Core CLI tool that retrieves metadata from a web service on a
network location or from a WSDL file, and generates a WCF class
containing client proxy methods that access the web service
operations.
> Install-Package dotnet-svcutil -Version 1.0.4
My project was using dotnet core 2.2. I had to use dotnet-svcutil 1.0.4 because higher versions did not work for me.
Installing dotnet-svcutil did the trick for me. You can search for dotnet-svcutil under "Manage Packages for solution" from Nuget Packages Manager under tools and then install

Deploying .Net Core WebAPI project on IIS

I have created a simple web API using .Net Core and trying to publish it to IIS. But getting HTTP 500.
I followed https://docs.asp.net/en/latest/publishing/iis.html article and did exactly whatever mentioned in that.
I Installed only https://www.microsoft.com/net/download as
DotNetCore.1.0.1-WindowsHosting.exe OPT_INSTALL_REDIST=0
NOTE : I am able to deploy and access MVC application successfully but cannot access WebAPI application with the same steps.
In the IIS logs i am seeing below error.
Failed to start process with commandline '"dotnet" .\Project-1.dll', ErrorCode = '0x80070002'.
I am using the default web api template provided in Visual Studio 2015
am i missing something. Is WebAPI deployment is different to MVC app deployment w.r.t .net core ?
When you install the .NET Core Windows Server Hosting bundle, it won't restart all of the IIS processes if IIS is currently running. This is a good thing, since on a production server you wouldn't want them just to restart, but it would be nice if it was made a little clearer. First, check your System (not User) PATH variable to ensure that the path to Dotnet is there. Then, go into services and restart the Windows Process Activation Service. This will restart all of the IIS bits and get it to update the path. Once you've done this, IIS should serve up your .NET Core app just fine.

Strong name signature not valid for this assembly Microsoft.LightSwitch.Model.Xaml.dll

I deployed a desktop lightswitch application and my users are getting this error when they install the application:
Strong name signature not valid for this assembly Microsoft.LightSwitch.Model.Xaml.dll
This error is causing the install to fail. Does anyone know the cause of this error or where to start looking?
What happened in my case is that VS 2013 has upgraded my LightSwitch app to .net 4.5 framework. The app works ok on machines with .net 4.5 but on machines with 4.0 I get the exact same error during installation process. You can either downgrade the app to .net 4.0 or ask users to install .net 4.5.

Where is Web Deploy's httpHandler configured?

I verified that I have installed Web Deploy 3.5 and I can see the Web Management Service running in services.
When I attempt to deploy to this service with VS 2010 or msdeploy.exe on the command-line, even locally, to https://servername.com:8172/Msdeploy.axd?site=mySite, I get a 404 returned from IIS.
It is my suspicion that I should see the httpHandler among those listed in the .NET 4.0 Web.config, but I do not.
The web deployment handler is installed by Web Deploy which needs to be installed onto the server. You can find the installer at http://www.iis.net/downloads/microsoft/web-deploy with a couple of installer options available. Make sure you include the "IIS 7 Deployment Handler" when you install it. From there you'll probably want to take a look at this article which explains how to get the correct permissions to the correct user accounts.
There's nothing in your project web.config that would be required to make it work. That's why the deployment handler is available on a separate port (8172).

Microsoft ASP.NET Web API 2 on .net 4.0

Is it possible to use ASP.NET Web API 2 with .net 4.0? I tried to upgrade from an older version but I get:
Could not install package 'Microsoft.AspNet.WebApi.Client 5.0.0'. You
are trying to install this package into a project that targets
'.NETFramework,Version=v4.0'
To answer my own question:
No, it is NOT possible to use Web API 2 with .net 4.0:
This is taken from a slide by Damian Edwards. You can find additinal info here.
FWIW, I had a .NET 4.0 requirement on the client (die WinXP!), but I could do .NET 4.5 on the server. So, I have WebApi2 running server side, but the WebApi1 client package running on the client, handling serialization, etc.
Using the Package Manager Console in Visual Studio and choosing my client project in the default project dropdown, I was able to:
Install-Package Microsoft.AspNet.WebApi.Client -Version 4.0.30506.0
Everything thereafter worked well.

Resources