Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6009593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:59:35+00:00 2026-05-23T01:59:35+00:00

When it use with type instance ident and direct property members in F# coding,

  • 0

When it use with type instance ident and direct property members in F# coding, run it in WCF host, and call it from client, the errors occured as below

System.InvalidOperationException: There was an error while trying to deserialize parameter http://tempuri.org/:…. Please see InnerException for more details. —> System.InvalidOperationException: The initialization of an object or
value resulted in an object or value being accessed recursively before it was fully initialized

[<DataContract>]
type A()=
  [<DefaultValue>] val mutable _Column:DateTime
  [<DataMember>]
  member x.Column
    with get ()=x._Column
    and set v=x._Column<-v

//===============================================
//***1.***
//It's wrong with type instance ident and direct property members
//Use without 'DefaultValue'
[<Sealed>]
[<DataContract>]
type B=
  inherit A
  val mutable _ColumnA:DateTime   
  new ()={inherit A();_ColumnA=DateTime.Now}
  new (para) as x=new B() then  //Type instance ident is 'x'
    do
      x.Initialize () 

  member x.Initialize ()= 
    "TODO" |>ignore

  [<DataMember>]      //the type have direct property members
  member x.ColumnA
    with get ()=x._ColumnA
    and set v=x._ColumnA<-v   //The error will occurs  in this position, 'The initialization of an object or value resulted in an object or value being accessed recursively before it was fully initialized'

//===============================================
//***2.***
(*
//It's wrong with type instance ident and direct property members
//Use with 'DefaultValue'
[<Sealed>]
[<DataContract>]
type B=
  inherit A
  new ()={inherit A()}
  new (para) as x=new B() then  //Type instance ident is 'x'
    do
      x.Initialize () 
      x.ColumnA<-DateTime.Now

  member x.Initialize ()= 
    "TODO" |>ignore

  [<DefaultValue>] val mutable _ColumnA:DateTime   //Use with 'DefaultValue' 
  [<DataMember>]      //the type have direct property members
  member x.ColumnA
    with get ()=x._ColumnA
    and set v=x._ColumnA<-v   //The error will occurs  in this position, 'The initialization of an object or value resulted in an object or value being accessed recursively before it was fully initialized'
*)

//===============================================
//***3.***
(*
//It's right with type instance ident and without direct property members
[<Sealed>]
[<DataContract>]
type B=
  inherit A
  new ()={inherit A()}
  new (para) as x=new B() then  //Type instance ident is 'x'
    do
      x.Initialize () 

  member x.Initialize ()= 
    "TODO" |>ignore

*)

//===============================================
//***4.***
(*
// it's right when it's without type instance ident!
[<Sealed>]
[<DataContract>]
type B=
  inherit A
  new ()={inherit A()}
  new (para)=new B() then
    do
      "TODO" |>ignore
*)

Many thanks to Brian’s reviewing and modification.

How can I correct this?

//------------------------------------------------------------
Addition,

namespace NS
open System

open System.ServiceModel
[<ServiceContract>]
type IService =
  [<OperationContract>] abstract Query:isAsceding:bool->B[] //The parameter name 'isAsceding' is needed in WCF enviroment


namespace NS
open System
open System.ServiceModel
[<ServiceBehavior(Name="NS.Service",InstanceContextMode=InstanceContextMode.Single) >]
type Service() =
  interface IService with
    member x.Query isAsceding=
      //TODO 


<system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="Shared_wsHttpBinding"
                     closeTimeout="00:02:00"
                     openTimeout="00:02:00"
                     receiveTimeout="00:10:00"
                     sendTimeout="00:02:00"
                     bypassProxyOnLocal="false"
                     transactionFlow="false"
                     hostNameComparisonMode="StrongWildcard"
                     maxBufferPoolSize="52428800"
                     maxReceivedMessageSize="6553600"
                     messageEncoding="Text"
                     textEncoding="utf-8"
                     useDefaultWebProxy="true"
                     allowCookies="false">
                <readerQuotas maxDepth="3200"
                              maxStringContentLength="819200"
                              maxArrayLength="1638400"
                              maxBytesPerRead="409600"
                              maxNameTableCharCount="1638400" />
                <reliableSession ordered="true"
                                 inactivityTimeout="00:10:00"
                                 enabled="false" />
                <security mode="Message">
                    <transport clientCredentialType="Windows"
                               proxyCredentialType="None"
                               realm="" />
                    <message clientCredentialType="Windows"
                             negotiateServiceCredential="true"
                             algorithmSuite="Default" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:8080/Service"
                  binding="wsHttpBinding"
                  bindingConfiguration="Shared_wsHttpBinding"
                  contract="NS.IService"
                  name="WSHttpBinding_IService">
            <identity>
                <dns value="localhost" />
            </identity>
        </endpoint>
    </client>
</system.serviceModel>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:59:35+00:00Added an answer on May 23, 2026 at 1:59 am

    The issue has been fixed by microsoft, so the next version will do right thing, please see here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On a web project for a client, we want to use a type of
I cannot find a way to use a first-class Type object (System.Type instance) as
I use Type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) to retrieve an array of
Can I use type as a name for a python function argument? def fun(name,
Is there ever a reason to use Type parameters over generics, ie: // this...
I'm curious as to how often experienced Haskell programmers really use type inference in
We use custom type to represent Identifiers in our project. It has TypeConvertor attached
How can I use UIViewAnimationTransition type in one of UINavigation / TabBar transitions ?
I am use next type of strings: LPCSTR, TCHAR, String i want to convert:
Is it possible to actually use the type passed as a template for control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.