Azure Mobile Services & Newtonsoft.Json 7 - c#

I recently upgraded Newtonsoft.Json in my project from version 6(.0.6) to 7(.0.1).
When i tried to publish the project to Azure i got an unhealthy service and the following message in the Logs:
ERROR
Found conflicts between different versions of the same dependent
assembly 'Newtonsoft.Json': 6.0.0.0, 7.0.0.0. Please change your
project to use version '6.0.0.0' which is the one currently supported
by the hosting environment.
Does that mean that azure doesn't support Newtonsoft.Json 7, or am i doing something wrong? Have i forgot something? If azure doesn't support version 7 is there a workaround? I must use thath version because i am trying to install a 3rd party package that requires it.

Azure Mobile Services has specific hosted versions of its NuGet packages and dependencies and does its own binding redirects at runtime. Unfortunately, this means you have to use Newtonsoft 6.0.4. This is specified as a dependency in the nuspec for WindowsAzure.MobileServices.Backend: https://www.nuget.org/packages/WindowsAzure.MobileServices.Backend/
What I recommend instead is that you use Azure Mobile Apps which removes this limitation. Mobile Apps is still in preview, but we recommend that customers building a new app start here. Mobile Apps is part of App Service and provides all of the benefits of that platform, such as VNET/VPN, backup and restore, more scale options, more CI options, WebJobs, etc.

Related

Azure Mobile Apps Server on .NET 5

What is with this stuff? As of today, there is no support to write a backend in C#/Net.
The Repo is super old and does not contain anything but .NET Framework examples. The packages produced are obviously not NET 5 compatible, although this is not listed in the Nuget browser.
This seems to be the current site, but the server example in ASP.NET is broken and even the quickstart documentation for the client code refers to a deployment of the NodeJs server.
You can get the server example to compile by rewiring some dependencies to the Datasync projects in the Repo, however I wasn't able to run it (probably due to my lacking knowledge of Azure configuration stuff).
Any news?
ASP.NET Framework SDK for Azure Mobile Apps
Create an Azure Mobile Apps ASP.NET Framework backend
Download and initialize the SDK
select Manage NuGet Packages...., Install
Microsoft.Azure.Mobile.Server
Microsoft.Azure.Mobile.Server.Quickstart
Microsoft.Owin.Host.SystemWeb
Initialize the server project
Add Startup class
Include Microsoft SDK extensions
Microsoft.Azure.Mobile.Server.Quickstart, Microsoft.Azure.Mobile.Server.Home,
Microsoft.Azure.Mobile.Server.Tables, Microsoft.Azure.Mobile.Server.Entity,
Microsoft.Azure.Mobile.Server.Authentication,
Microsoft.Azure.Mobile.Server.Notifications,
Microsoft.Azure.Mobile.Server.CrossDomain,Microsoft.Azure.Mobile.Server.Login
Publish the server project in Azure
Please follow the ASP.NET Framework SDK for Azure Mobile Apps for reference.

Azure Function Adding Reference to Sharepoint.dll Failing

I am getting an error when I attempt to add a reference to the Microsoft.Sharepoint.dll into my Azure function class. It keeps giving me the following error:
Package Sharepoint 15.0.0 is not compatible with net462 (.NetFramework, Version=v4.6.2). Package Sharepoint 15.0.0 supports microsoftsharepoint (Microsoft.SharePoint,version=v0.0).
Also the Microsoft.Sharepoint.Client.Runtime has a similar issue.
Given this I have followed other advice to switch the targeting framework to 4 and 4.5 but all of these seem to fail similarly. What is the supported framework for this and how can I add it into an azure function. Also I am dealing with an on-prem instance of sharepoint so I cannot connect via the online apis.
The Microsoft.Sharepoint.dll have no dependencies so, it it no matter with framework. I test in my site and could install it correctly.
You could try to use the Package Manager console in Visual Studio to install instead of the Manager Packages tool for the project.
And if you use Manage Nuget Packages, delete Nuget's cache from the packages' manager configuration.

GRPC C# Library For a Windows 8.1 Phone App

Is it possible to use GRPC C# library with a Windows Phone App? When I try to install GRPC through NuGet I receive the following error:
Error Could not install package 'Grpc.Core 1.0.0'. You are trying to install this package into a project that targets 'WindowsPhoneApp,Version=v8.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0
Has anyone had any luck installing GRPC C# library for a windows phone app?
As of now, Windows Phone Apps are not supported by gRPC C#. Technically, supporting them would be possible but we are not sure it's worth the work at this point - we have different priorities (User experience, performance and supporting other platforms).
Here's a github issue that tracks the discussion: https://github.com/grpc/grpc/issues/7859

Azure mobile service version conflict with Microsoft.Build.Framework

I just created my first Azure mobile service. After I published the service the service health changed to critical and I get following error:
"Found conflicts between different versions of the same dependent assembly 'Microsoft.Build.Framework': 4.0.0.0, 14.0.0.0. Please change your project to use only one version."
How can I resolve this error? In my dependencies I cannot find something like Microsoft.Build.Framework.
This can happen when the NuGet references in your project don't match what is hosted in Azure.
The best way to ensure you don't have any issues is to download the quickstart solution from the Azure Portal and deploy that. The latest versions of the NuGet packages will makes sure that you don't introduce incompatible dependencies. See this tutorial for more: https://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-windows-store-dotnet-get-started/#test-the-app-against-the-local-mobile-service

Where to configure Razor page language version to C# 6?

Recently I've tried to use some C# 6 new feature (interpolated strings) in my ASP.NET MVC (5) .cshtml view, but when running got an error message complaining about the $. It is clear the compiler in C# 5 compatibility mode, or worst it is a C# 5 compiler.
When in editor a popup warning warns me (I do not know it is VS or ReSharper) Feature 'Interpolated strings' is not available in C# 5. Please use language version 6 or greater.
The project itself was set to C# 6, and I can use C# 6 features in my build time compiled code like controllers etc.
Q: Where should I set page compiler version, and will this C# 6 compiler available when I deploy my web app to Azure there?
From String interpolation in a Razor view?:
This only works in MVC6. Alternatively, also from a comment on this link, you'll need to add the roslyn code dom package from ASP.Net.
<div>
#($"Hello {this.Model.SomeProperty}")
</div>
As far as Azure is concerned, please see this link. http://azure.microsoft.com/blog/2015/08/11/update-on-net-framework-4-6-and-azure/
With great power… The tooling, framework and Azure platform teams want
to ensure the powerful tools we give you to help build your dream is
matched by the responsibility we recognize we have to keep it running
in the cloud. At the time of the Visual Studio and Azure SDK 2.7
releases, Framework 4.6 wasn’t supported broadly throughout Azure.
This is due in large part to the fact that just as many teams (or
more) are responsible for the ongoing development and stability of the
Azure platform.
For now, we have an update on the availability of .NET Framework 4.6
for Azure App Service and an article demonstrating how to get .NET
Framework 4.6 working in your Cloud Service roles.
Azure IaaS
For customers using Azure’s Infrastructure as a Service
(IaaS) services, installation of .NET Framework 4.6 is manual. To
install .NET Framework 4.6 on an Azure IaaS virtual machine, the
process is as simple as logging into the virtual machine using Remote
Desktop. Once on the machine, the .NET Framework 4.6 installer can be
downloaded and installed directly onto the virtual machine. Customers
using Azure Automation could also choose to automate the installation
onto Azure virtual machines using PowerShell.
Azure App Service
Update The Azure App Service team is nearing the end
of the testing phase for .NET Framework 4.6 and planning the
deployment to the environments. Currently, the plan is to roll out the
updates to Azure App Service during August 2015.
Azure Cloud Services
Saurabh Bhatia authored an article in the Azure
documentation center outlining how to install the .NET Framework in a
Cloud Service Role. The content has been recently updated to include
commentary specific to .NET Framework 4.6. You can find the updated
article here on the Azure documentation center.
For me installing the Microsoft.CodeDom.Providers.DotNetCompilerPlatform NuGet package solved the problem.

Categories