InvalidCastException after upgrading to EF Core 5.0 - .net-5

I've just upgraded my project from .NET Core 3.1 to .NET 5.0 and updating all packages to the latest version. All built fine, but now I'm having trouble loading some entities, getting this error:
Unable to cast object of type 'Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader' to type 'Microsoft.Data.SqlClient.SqlDataReader'.'
I'm not certain, but I have a couple of entities which have an Address property which is an[Owned] type which has a NetTopologySuite.Geometries.Point property, and I suspect perhaps this is the culprit.
I'm sorry that this question is so vague but I'm pretty stumped on what's wrong here, or how to diagnose it any further, if anyone has any ideas or pointers I'd be very grateful to hear them!
Edit: It's definitely an issue with NetTopologySuite. Barebones project here demonstrating the error

Related

HttpUtility.ParseQueryString Mono 4.8 Xamarin Mac Upgrade Issue

I have an app I have been working on that was running fine.
I upgraded to the latest Xamarin with mac support and now I get an error when I try to use HttpUtility.ParseQueryString.
I have an App.config file and it is telling me that it can't parse it, but this happens when trying to call ParseQueryString. How are those 2 related?
I thought I had found the problem because my app also has a ServiceReferences.ClientConfig file for http client settings. I copied my App.config section to the ServiceReferences.ClientConfig file and that fixed it until I went to show my fellow dev the new error.
The new error was saying something about Path.Combine path1 being null.
I looked up that error and found a reference to a page talking about MacSupport in xamarin here: https://searchcode.com/codesearch/view/8556026/
I don't know if they are related, but that is the closest I found to the stack trace I was seeing.
Can anyone tell me what changed in Mono 4.8 for Mac in Xamarin that would cause an issue with HttpUtility.ParseQueryString and how to solve it?
System.Configuration is a common point of pain during mono upgrades, as it's behavior sometimes subtly (or not so subtly) changes.
You'll need to post a much larger chunk of information here for anyone to be able to help you.
Or you could post on the XM Forms or file a bug if you believe this is a bug, as those are a more appropriate place for such reports.

initWithCoder has been explicitly marked unavailable error using newest version of Xamarin.iOS

I'm seeing the following error during compile time when working with the latest version of Xamarin.iOS that was released yesterday:
UIActivityViewController.h:23:1: note: 'initWithCoder:' has been
explicitly marked unavailable here
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
I don't recall ever having this issue before and my code hasn't changed much between the last update and now. Can anyone help me figure out what's going on?
It's a known issue which is harder to diagnose because of a clang bug, i.e. it has nothing to do with UIActivityViewController.
You might be able to workaround this by removing [Export ("initWithCoder:")] inside your code. That should be fine unless your managed object needs to be created from native code. YMMV

Xamarin Android Support V4 error

I started a new default working project in xamarin and I added the dll references for Xamarin.Android.Support.V4 and Xamarin.Android.Support.V7.AppCompat and I am getting errors.
Error: package android.support.v4.app.FragmentManager does not exist
android.support.v4.app.FragmentManager.OnBackStackChangedListener
Error: package android.support.v4.content.Loader does not exist
android.support.v4.content.Loader.OnLoadCompleteListener
...
What have I done wrong?
You needed to actually install the support library. MonoDroid has .NET bindings for it, but the underlying java can't build without it, of course. Here are instructions for getting the support library and instructions for hooking it up to a MonoDroid project.
See also http://developer.xamarin.com/Guides/Android/Platform_Features/Fragments/Part_4_-_Providing_Backwards_Compatibility_with_the_Android_Support_Package/#Adding_The_V4_Libraries_to_a_Mono_for_Android_Project
This might be related to this or this, which were solutions to common problems in the rev. 22 update.
try calling it with this:
using Android.Support.V4;
I was reading another post in the xamarin forms with the same issue and this worked for me. I spent maybe an hour trying to figure out what to do and the guy I ran into said just to:
clean the solution,
rebuild it,
then it should be fixed.
Assuming the packages are still installed

Using Web.Caching on XP Running IIS 5.1 Not available?

Environment: I am working on a site in ASP.Net 2.0 running on IIS6; I am developing locally on WinXP which runs IIS 5.1, using VS2005 and VB.
Issue: I am trying to create caching for some business layer objects (actually creating a caching layer) using System.web.caching.cache. This should be available under System.Web namespace but all that I seem to have access to are: AspNetHostingPermission, AspNetHostingPermissionAttribute and AspNetHostingPermissionLevel (I have a reference to System.Web in the project and imports in the class). There are quite a few other classes (e.g., HTTPRuntime) which also do not appear (this is per the "Using SQL Cache Dependencies" tutorial http://www.asp.net/web-forms/tutorials/data-access/caching-data/using-sql-cache-dependencies-vb).
I'm at the end of my rope and can't seem to find anything out there to explain this. Has anyone been in this situation and seen this before? Any help getting this solved is MUCH appreciated!
OK, so not sure why I didn't think of this before but I checked the references tab under the project properties. In the list for System.web, the additional namespaces were unchecked; checking System.Web.Caching and recompiling fixed the issue.
Sometimes you're just toooooo close to something to realize the easy answer.

strange problem with referenced log4net assembly

I'm not sure if this problem is connected specifically with log4net or this is some problem with VS.
Everytime I'm trying, I have the same result. But let's start from the beginning.
I'm creating a simply console application (.net 4) and using nuget to install the log4net library.
Now, when I want to add some code from it, intellisense works ok:
But when I try to compile it, I have an error
This is the only one assembly I found to this moment, I have this problem with. I have absolutly no idea what (and why) is going on. I have checked with two other solutions and problem is the same. I have not checked manually downloaded version yet.
Most likely there is an underlying dependency that is missing. One very common reason is the project is using the Client Profile instead of the full .NET 4.0. (Not sure about log4Net, but I run into this a lot when including third party libraries, esp. those with ties to the web). If I am correct, simply going into properties and changing the framework version to full .NET 4.0 will solve the issue.

Resources