BinaryFormatter .NETFramework 4.6.1 and 2.0 result is different - c#-4.0

old project is .net 2.0 now want to 4.6.1 but BinaryFormatter result is different.
please help me fix it.

Related

How to find which version of RazorEngine works with which .net framework?

It am struggling to find out the simple information of which RazorEngine version works with which version of .net framework.
I am basically looking for the version that can work with .net core 2.2, but the dot net core version of Razor Engine (RazorEngine.NetCore 3.1.0) works only with .net core 3.1 and .net standard 2.0
I searched everything here https://github.com/Antaris/RazorEngine but could not find the .net core 2.2 compatible version of RazorEngine
Can anybody help?

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

Is Microsoft.Azure.NotificationHubs 1.0.9 compatible with .NET Core 2.0?

We are using NotificationHubs version 1.0.9 with .NetCore 2.0 and .Net Framework 4.7.
At compile time, we get this warning:
"Package Microsoft.Azure.NOtificationHubs 1.0.9 was restored using '.NETFramework, version=4.6.1' instead of the project target framework '.NETCoreApp, version=2.0. this package may not be fully compatible with your project."
Everything is still built, but at runtime when this call is invoked:
RegistrationDescription hubRegistration = await hubClient.CreateAppleNativeRegistrationAsync(device.DeviceToken); //hubClient is NotificationHubClient
We get this error:
Has anyone encountered this before and have any idea how to fix it?
At compile time, see this warning: "Package Microsoft.Azure.NOtificationHubs 1.0.9 was restored using '.NETFramework, version=4.6.1' instead of the project target framework '.NETCoreApp, version=2.0. this package may not be fully compatible with your project."
The Microsoft.Azure.NotificationHubs package requires .Net Framework 4.5 Full Profile. And here is a feedback Microsoft.Azure.NotificationHubs add support for .NET CORE.
AFAIK, if you create the ASP.NET Core Web Application with the target framework at .NetCore 1.0 or .NetCore 1.1, you could edit your *.csproj and change the TargetFramework to net461, then you could install and use Microsoft.Azure.NotificationHubs 1.0.9.
While for .NetCore 2.0 MVC, after you create the project, it would reference the Microsoft.AspNetCore.All 2.0.0, and this package supports netcoreapp2.0. I assumed that you could leverage Notification Hubs REST APIs and follow the git sample azure-notifications Send REST to access your notification hub for a workaround.
A preview version of a .NET Standard compatible NuGet is now available. It will allow using Notification Hubs with .NET core.
According to a Microsoft Product Manager a new version of the .NET SDK supporting .NET Core will be deployed very soon.
cf this question
But no mention on Feedback Microsoft site. I would recommend to vote for this feature

Receiving error 'Could not load file or assembly 'Interop.SearchAPI' or one of its dependencies.'

The full message is 'Could not load file or assembly 'Interop.SearchAPI' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.'
After changing some application pools in IIs 7.5 from 2.0 to 4.0 and then back to 2.0 I now receive the above error message. I'm not sure what I need to do to switch the assembly from 4.0 to 2.0.
Thanks for the help!!
Gary
You did not tell us what was your reasons for switching from .NET 4.0 to .NET 2.0.
There are major differences between these runtimes. You can load .NET 2.0 assembly in .NET 4.0 environment but it is not possible to do the other way. If you need to run your application in .NET 2.0 environment then the only option for you is to rebuild all assemblies using .NET 2.0 (or max. .NET 3.5 because the underlying CLR format is the same).
You can read more about .NET versions and compatibility here and here.

Is it possible to have single (portable?) library for .NET 3.5 and .NET 4.5?

We have a large project targeting SharePoint 2010/.NET 3.5 built against the SharePoint.dll and we plan to expand it to support SharePoint 2013 as well, but the new SharePoint uses SharePoint.dll compiled in .NET 4.5.
Is it possible to somehow share code between .NET 3.5 and .NET 4.5 projects, something like Portable Class Libraries, but between .NET 3.5 and 4.5? Or the only solution is starting new project for .NET 4.5 and using referenced files from the first .NET 3.5 project?
The .NET build target is per project, so a 4.5 solution can include a project library targetting 3.5. Your can have a 4.5 library that extends the 3.5 solution where required and your main solution can build to 4.5 and include the 4.5 library.
Thus both the 3.5 solution and the 4.5 solution use the same 3.5 SharePoint code library, but the 4.5 solution can extend your SharePoint library to take advantage of new features not available in 2010 and .Net 4.5

Resources