Upgraded to EF Core 3.1 and now IProperty.get_ClrType is missing - ef-core-3.0

When I upgraded my project from EF Core 2.2 to EF Core 3.1 I started getting this error:
Method not found: 'System.Type Microsoft.EntityFrameworkCore.Metadata.IProperty.get_ClrType()'.
This is in a Breeze module.
I looked in the Breaking Changes and could not see anything that matches this (though it could be that the metadata references are including this and I just don't understand them).
Is this supposed to be missing? Is there a workaround?

Related

Azure MobileServiceClient can InsertAsync but not ReadAsync

I can create a MobileServiceClient and GetTable<Model>() to InsertAsync, and see how my model gets inserted in the Easy Table table in Azure. But when I ReadAsync() from the table I get the following error:
Microsoft.WindowsAzure.MobileSerices.MobileServiceInvalidOperation: The server did not provide a response with the expected content.
This is when I mobileServiceClient.GetTable<Model>.ReadAsync()
What could be the problem?
This was when running from an MsTest project with no Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); call. The read worked when running the app
I had the same problem.
According to GitHub Issue:
As #elamalani pointed out above, we don't support .Net Core 2.1 in the SDK today. Unfortunately, we don't have a workaround today and like Ela said, the we don't have an ETA for a new release or other SDK to use for .Net Core 2.1 compatibility yet, so your only workaround is to stick with .Net Core 2.0 for now.
And I was also had SDK version 2.1
After changing SDK to version 2.0 all going to work fine. Please try to making the same, hope it will help you

How can I use a Service Model from ServiceStack 4.0 in a ServiceStack 5.0 Project?

I have begun the process of migrating one of our many ServiceStack services from .Net Framework to .Net core. Most of the migration has been relatively smooth, but I have run into a brick wall with Service Models. This service is dependent on using other ServiceStack services that are still on version 4.0. When I attempt to use Service Models from those services in the new project I get an error saying that the IReturn<> interface wants the version 4.0 assembly specifically, and does not want the 5.0 version of ServiceStack.Interfaces. Downgrading just ServiceStack.Interfaces causes a similar error, but the inverse where everything else that depends on that assembly wants version 5.0. Is there a way to upgrade one project without upgrading every project? I think we all know that real systems need a transition period, and that there's just no way to migrate every service simultaneously.
Please read the existing links from this answer:
https://stackoverflow.com/a/51252374/85785
TL;DR you can’t share the same .dll, you either need to multi-target or decouple the binary dependency by using C# Add ServiceStack Reference.
Other solutions is having old Framework projects Reference the old compiled ServiceModell.dll (alternative to multi targeting) or just copy the source code of the DTOs you need (alternative to C# Add ServiceStack Reference).

HttpRequestMessageExtensions not being found at run-time in Azure Function

I've got an Azure Function app that creates a precompiled DLL (so it uses normal .cs files, not the older .csx method, pre-VS2017). Previously, it was targeting .Net Framework 4.5.2. I updated it to 4.7 so as to use some of the new C# 7 features. I updated my NuGet packages by doing "Update-Package -Reinstall" and verified that they all have the "net47" target set in my packages.config file.
Everything compiles fine. But when I call a function that uses either of 2 HttpRequestMessageExtensions methods, I get an exception. One example of the exception is this:
Method not found: 'System.Net.Http.HttpResponseMessage
System.Net.Http.HttpRequestMessageExtensions.CreateResponse(
System.Net.Http.HttpRequestMessage, System.Net.HttpStatusCode)'.
Here's an example of a tiny test function that will cause the error:
using System.Net;
using System.Net.Http;
public static HttpResponseMessage Run(HttpRequestMessage req)
{
return req.CreateResponse(HttpStatusCode.Accepted, "");
}
Upon calling this function with say Postman, I'll receive the aforementioned exception. I also get a similar method not found exception when I call GetQueryNameValuePairs() on the HttpRequestMessage.
I've tried updating my NuGet packages to the latest, no difference. I've cleaned and rebuilt and restarted a bunch of times, making sure to nuke my bin and obj directories.
I'm not sure what could be the problem. I guess I could downgrade back to .Net 4.5.2 but I'd rather not. For one, I want to use C# 7, and for two, I want to understand what the problem is rather than avoid it.
Update: interesting. The issue seems to be with System.Net.Http. If I lower it to 4.0.0 everything works fine. If I raise it to any higher version I get the issues listed above. I tried selectively lowering each of my packages, one by one, to their previous version number to find this out. I then updated all but this one to the latest version and it fixed the issue.
I also tested it on my side. The issue is related to the latest version of System.Net.Http assembly(4.3.2). If I don't install this package manually or install the earlier versions(4.3.1/4.3.0), the application could work fine.
The CreateResponse method is a extension method which is written in System.Web.Http assembly(version 5.2.3). It seem that it is not compatible with the latest version of System.Net.Http. Please could just skip the error by using the earlier version of System.Net.Http and you can also submit this issue to Microsoft using follow channel.
https://connect.microsoft.com/VisualStudio/Feedback
Interesting. For me, if I got above version 4.0.0 (including 4.1.1 or 4.3.1) I still get the same problem of not finding those extension methods.
The assembly might not be updated during you change the package version. From the bin\Debug\net47 folder, we could check the current assembly version we used.
If the modified date of assembly is 2/9/2017, the package version is 4.3.1. If the modified date of assembly is 4/19/2017, the package version is 4.3.2. If the assembly is not the latest version, it could work fine on my side.
In addition, Microsoft.Asp.Net.WebApi.Client package is installed by default when creating an Azure function. System.Net.Http is one of its dependencies. So we don't need to install the System.Net.Http package manually. When running our application, NuGet will choose a right version of System.Net.Http for our application.
I had the same issue running my Azure Function locally and eventually tracked it down to conflicting System.Net.Http assemblies. I created my Azure function from a blank ASP.NET Web App and initially pulled down the System.Net.Http NuGet package to use within the project. I also pulled down the Microsoft.AspNet.WebApi.Client for use within the project. It did not matter which version of System.Net.Http I tried my project would compile but fail when the request was made.
Eventually, I removed packages I had downloaded, cleaned the build folder and added just the Microsoft.AspNet.WebApi.Client. I noticed that this automatically referenced the System.Net.Http on my machine for my version of the .NET Framework. (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework). This compiled successfully and I was able to make requests to the function without any exceptions.
Using #Aaron-Newton's insight, I identified that my issue was due to my Azure Functions project referencing a .Net Standard 2.0 class library. I switched it to .Net Framework 4.6 and it started working again. Seems like this is a bug in the Functions tooling.
I've filed a bug with the Functions team here: https://github.com/Azure/Azure-Functions/issues/477
I had the same issue. I spent quite a while to fix this problem.
The cause is that the Azure Functions project is refering to .Net Standard Library with version higher than 1.4.
Bringing down your .Net Standard version to 1.4 or lower would fix the problem.
But this is defintely a bug with Azure Functions SDK. They should fix it.
https://github.com/Azure/azure-webjobs-sdk-script/issues/980
https://github.com/Azure/Azure-Functions/issues/477

FacebookSDK.h not found - Xcode 6.2, Facebook-iOS-SDK 4.0

I am using Xcode 6.2, Facebook-iOS-SDK 4.0. I used to have working code with Facebook-iOS-SDK 3.20.0.But, now I am getting compile-time error FacebookSDK.h not found. I am using pod to install sdk. Can someone give me any pointers why this is happening?
The SDK (v 4.0) is no longer one framework named "FacebookSDK", but rather a few different packages with a naming convention of "FBSDKTypeKit", where types are different things like Core and Login. This means the name of the header files have also changed, so that's why your project can no longer find FacebookSDK.h (as it's now FBSDKCoreKit.h).

Enable-Migrations fails for EF5

I am using .NET 4.0 and Visual Studio 2010 (which I will eventually upgrade, but not quite yet). I ungraded from EF 4.1 to EF 5 via NuGet and ran Enable-Migrations (via the Package Manager Console) but got this error
No context type was found in the assembly 'UI'.
I Googled around and found this SO post.
The scenario described by the poster is slightly different as he is using VS 2012 and .NET 4.5. Either way I'm not sure if this will solve my issues. Do I need to be using VS 2012 and .NET 4.5 to use Migrations? How do I solve my issue?
In order to NuGet commands work correctly, you should specify the default project:
So you should change the dropdown value from UI to Model (I presume). Actions should not depend on VS version.

Resources