JSON for .NET Framework 1.1 - json

I can see that JSON used a lot for .NET 2.0 and higher.
Is there a JSON library I can use for .NET Framework v1.1 ?

There have been a few attempts to bring JSON to .NET 1.1. Given such an old Framework version you are on, most of those attempts have been abandoned by people moving on with the next version of the .NET Framework (which I encourage you to do).
Barring that, you could try JSON Object Serializer. I'm sure it isn't perfect, but it is open source - allowing you to make contributions and bug fixes for it yourself.

Related

Using Avalonia with netstandard

I try to run my Avalonia app on .net framework. However, when I downgrade targetframework to netstandard2.0, AppBuilder becomes unavailable and I just couldn't figure out, how to fix that problem.
I couldn't find any template, that targets .net framework or netstandard. Documentation contains nothing regarding this issue. The only thing I could find is this Github issue. As I understood, AppBuilder is not supposed to be used in netstandard. Then, what is proper replacement for following code?
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace()
.UseReactiveUI();
Edit:
As it was pointed out, netstandard can't be used as a target for Avalonia apps, but we can specify multiple targets. So I replaced
<TargetFramework>net7.0</TargetFramework>
with
<TargetFrameworks>net7.0;net48</TargetFrameworks>
And it worked on .NET core and .NET Framework
netstandard2.0 isn't an actual .NET framework version: it's a specification of the common API beteen .NET framework 4.6.1 and .NET core 2.0 (among others). As such netstandard2.0 only makes sense as the target framework for libraries, not applications.
If you want your app to target .NET framework then you need to use a .NET framework version as the target framework, for example net48 for .NET Framework 4.8.

Xml serialization/deserialization in WinRT (Store application)

I need to make a Windows Store application that exchanges xml serialized data over a TCP connection with a server. Since I need to use Direct3D rendering in the application I went for the c++/cx store application template however I ran into issues with xml serialization/deserialization.
My usual approach in C# would be to use the XmlSerializer and classes with DataContractAttribute annotations. However as soon as I try to import System.Xml.Serialization assembly I get the C1114 error - WinRT does not support #using of a managed assembly. However there are lots of examples that mention using this approach in a Windows Phone app from C#.
So the question is - is only c++/cx limited in support for .NET in Windows Store applications and C# can use all the standard components on phone as well or is switching to C# in this case also not a solution and I need to use the WinRT classes for xml serialization/deserialization?
Your confusion is understandable, what with the variety of frameworks Microsoft has put out there.
C++/Cx is a native binding to the Windows Runtime (WinRT). It does not use any managed code or the .NET framework in any way, which is why you're getting the C1114 error.
C# provides a managed binding to WinRT. It does leverage the .NET framework, so in a C# Windows Store application, you can make use of some of the base-class library. This subset is referred to as the .NET Profile. This article talks about this more: http://blogs.msdn.com/b/dotnet/archive/2012/04/17/net-for-metro-style-apps.aspx
In your specific case, you are using a C++/Cx application because you want access to Direct3D. This makes sense, although it means that you will not have access to System.Xml.Serialization. Instead, as you surmised, you will need to use APIs that are available to C++/Cx to read XML, specifically Windows.Data.Xml.Dom: https://msdn.microsoft.com/en-us/library/windows/apps/windows.data.xml.dom.aspx

How targeting .NET 4.0 with Mvvmcross?

I want to use Mvvmcross to make application for several platforms.
I use Profile 104 for PCL library like Mvvmcross, but this profile target .NET 4.5.
I want to target .NET 4.0 to use my application on Windows XP.
To do that, I add the xml files
MonoAndroid, Version = v1.6 +. Xml
and
VSMonoTouch, Version = v1.0 +. Xml
in the profile 143 which allows me to target. NET framework 4.0.3.
However, I have a compilation error because it can not find the ICommand interface.
This interface is not in the same library between version 4.0 and 4.5, is it why it doesn't work ?
Or should I recompile all Mvvmcross libraries with profile 143?
thanks,
This is a Portable Class Library limitation.
See the table on: http://msdn.microsoft.com/en-us/library/gg597391.aspx
Model-View-View Model (MVVM)
Only 4.5
This means that if anyone wants to use MvvmCross on earlier .Net platforms then someone has to build and maintain a non-PCL version.
Since the maintainer of Mvx (me!) has decided to only maintain PCL versions of MvvmCross, then any non-PCL support will have to be created by the community.
For WPF this shouldn't be too large or difficult a job - but it might be...
Alternatively, somebody might be able to do something funky to get the ICommand working... I've retagged this question with portable-class-library to try to lure in some of the MS experts.

What is the difference between microsoft.identityModel and system.identityModel in .NET 4.5

I'm probably not the first to ask but which one should we use now ? As I understand it, it started with a very small System.IdentityModel for WCF. Then came the Microsoft.IdentityModel classes which added a whole lot more. This is the situation as in http://social.technet.microsoft.com/wiki/contents/articles/1898.aspx#v3q10
But now in 4.5, I see that System.IdentityModel has almost all classes from Microsoft.IdentityModel (although there seems to have been some refactoring and the configuration in web.config is slightly different).
Now Microsoft pre-releases a JSON Web Token Handler as a nuget, which depends on Microsoft.IdentityModel AND System.IdentityModel. (JWTSecurityTokenHandler resides in Microsoft.IdentityModel.Tokens.JWT, derives from System.IdentityModel.Tokens.SecurityTokenHandler).
This is getting quite confusing. Does anybody know which one I should use ?
The WIF 1.0 release, which is what you get when you download 'Windows Identity Foundation' from Microsoft, targeted .NET 3.5 (and was compatible with .NET 4.0). Since it was an out-of-band release, all types had to live in non-core namespaces (Microsoft.IdentityModel, etc.) and non-core assemblies.
The current WIF 4.5 release (they jumped in the version numbering if I've understood correctly) has been integrated directly into the core .NET 4.5 Framework. The most extreme example, the IClaimsPrincipal interface has been replaced by a ClaimsPrincipal base class from which all the .NET IPrincipal implementations now derive - this is directly in mscorlib.dll. Hence the System.IdentityModel, etc., namespaces.
The pre-released JWT Handler (nuget) is, of course, an out-of-band release. I wouldn't be at all surprised if it makes it into the core .NET vNext (assuming the JWT standard is finalized by then), but until then the framework naming guidelines require that JWTSecurityTokenHandler etc. reside in Microsoft.IdentityModel.
I can understand your confusion; I'm helped by the fact that I can start from scratch on my project with only .NET 4.5 to worry about - for now. :)
The WIF classes, which were collected under the Microsoft.IdentityModel namespaces in WIF 3.5, are now distributed among the following namespaces: System.Security.Claims, System.ServiceModel.Security, and the System.IdentityModel namespaces in WIF 4.5. In addition some WIF 3.5 namespaces were consolidated or dropped entirely in WIF 4.5.
Reference: https://learn.microsoft.com/en-us/dotnet/framework/security/namespace-mapping-between-wif-3-5-and-wif-4-5

Spring.net and Oracle Coherence integration

I probably suck as Googling stuff, but I couldn't find any link that mentioned whether its possible to integrate Spring.net with Oracle's coherance product.
Does anyone know if Spring.net has wrapper libraries for the same ?
Thanks in advance.
The spring integration project for .net is still listed as a spring.net extension project, it's status is "incubator" and it hasn't had any commits since March 2010.
From the project homepage:
The Spring Integration for .NET project will use the design and code
base of the Spring Integration project as a basis, adapting the code
as need to support .NET idioms and move in the direction to take
advantage of .NET only features such as Lambda expressions and
extension methods.
I'd suggest you first find out if Spring Integration for Java supports Oracle's Coherance and if so, you might have a slight chance to get this working in .NET too.
Oracle Coherence provides a native .NET client that you can use to access it from any .NET application, including Spring.NET-based apps.
Here is a link to docs:
http://docs.oracle.com/cd/E24290_01/index.htm
What you are interested in is covered in the Client Guide (Parts I and IV) and .NET API Reference.
My book, Oracle Coherence 3.5, also has two chapters on .NET and POF (Portable Object Format), as well as a full blown WPF sample application talking to a Coherence Java backend.