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
Related
I'm trying to run my azure function application as a docker image and when I do it throws me a System.PlatformNotSupportedException in Microsoft.Data.SqlClient.dll: 'Strings.PlatformNotSupported_DataSqlClient' exception any time I try to call my datalayer (no matter if its EF Core or Dapper that I use). I can run the application just fine when setting my API project as startup instead of the docker image.
There are very similar questions out there but none of them take into account that it is ONLY happening when I try to run it as a docker image or the fact that my target framework is netcoreapp3.1. I've already tried what the similar questions said. which is to add System.Data.SqlClient as a Nuget package which doesn't help no matter what version I make it.
I suspect I need to add something to the Dockerfile or something.
here is some additional information:
EDIT:
I am able to recreate the issue in a new project by simply creating an azure function, adding docker support, creating a simple data layer that performs a CRUD operation on a local database, then running the docker image and calling the endpoint that does the CRUD operation. Hope that helps.
The Microsoft.Data.SqlClient NuGet package includes a number of DLLs supporting different .NET targets and different runtime platforms. If you are getting a
PlatformNotSupported Exception
it ultimately means your application is not loading the appropriate DLL.
A different DLL for .NET Framework, .NET Core, .NET Standard, Windows, Linux, etc. The NuGet infrastructure will automatically reference and load the appropriate DLL based on your application's needs.
If your application loads a DLL from a NuGet package directly, it bypasses all this logic and probably loads the incorrect DLL.
The DLL in the NuGet package under lib/netstandard2.0/Microsoft.Data.SqlClient.dll is basically the fallback DLL for any unsupported target and simply throws the PlatformNotSupported exception for any call. This is a nicer exception than what you would otherwise get when running on a platform that does not have a DLL built for it. Ultimately, you want to use the NuGet package reference infrastructure or you would have to implement all this target framework and platform support logic yourself when determining which DLL to load.
Additionally, the NuGet package contains all the dependency information for the SqlClient library and facilitates the downloading and referencing of dependencies. If you reference and load an individual DLL manually, it is up to you to ensure all dependencies are also available to the SqlClient library.
Refer why do i get a platformnotsupported exception when my application hits a sqlclient method
You can update all your dependencies with latest versions. It may fix your problem. Please check the implemented target frameworks and platforms support the logic of your code.
Refer here Link 1 & Link 2
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.
I have asp net core 2.1 and integrated web services too. All works fine in my development environment. But on live environment I have an error:
System.IO.FileNotFoundException: Could not load file or assembly
'System.ServiceModel.Primitives, Version=4.5.0.3
I installed System.ServiceModel 4.5.3 and it is included also in the runtime folder but it is not finding it. Why? What I am missing?
Thanks
Your Reference to the package is probably local. If you are using ReSharper it sometimes references Nuget packages locally (I also had similar experience).
check your references under .csproj file, if they are referenced locally remove them and reinstall using Nuget Package Manager. This needs to solve your issue.
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.
I am trying to create an Azure Mobile Services cross platform app. I am using Xamarin.Forms, so have been trying to follow this tutorial. However, I am not getting very far... I create a new Xamarin Forms project in Visual Studio 2015 and opening the nuget manager. I try to install Azure Mobile Services into each project in the solution. But I get the following set of errors:
Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: System.IO.FileNotFoundException: Could not load assembly 'Azure_Test, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? Azure_Test.Droid
Could not install package 'Microsoft.Bcl.Build 1.0.14'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', 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.
I have filed a bugzilla case, but it seems like a pretty straight forward thing, so I wondered if there is anything I have done wrong there is a workaround?
Had this the other day. Before you install the Mobile Services package install the Microsoft.Bcl.Build nuget package. After that, I was able to install flawlessly.