Welcome, Guest
Username: Password: Remember me
This public forum is meant for questions and discussions about Visual FoxPro
  • Page:
  • 1

TOPIC:

Error XS0656 Missing compiler required member 27 Apr 2020 02:54 #14249

  • FoxProMatt
  • FoxProMatt's Avatar
  • Topic Author



What is causing this error?

It's related to the use of Text/EndText in the running code.

Error XS0656 Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create' VPF Xsharp test app 1 H:\Work\Repos\XSharp Projects\VPF Xsharp test app 1\VPF Xsharp test app 1\SqlBoBase.prg 50


Please Log in or Create an account to join the conversation.

Error XS0656 Missing compiler required member 27 Apr 2020 02:59 #14250

  • FoxProMatt
  • FoxProMatt's Avatar
  • Topic Author



Okay, I found the answer in another thread here be searching for "XS0656".

The answer is that you must add a reference to Microsoft.CSharp.dll into your project.

Please add this info to the Help File for the Text/EndText function in the docs: www.xsharp.eu/help/command_text.html

Attachment not found

Please Log in or Create an account to join the conversation.

Last edit: by FoxProMatt.

Error XS0656 Missing compiler required member 27 Apr 2020 08:22 #14253

  • Chris
  • Chris's Avatar


  • Posts: 3980
  • Hi Matt,

    TEXT/ENDTEXT does not require this reference, at least not in any case I am aware of. Are you using DYNAMIC vars elsewhere in your code? Those indeed need this reference.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Error XS0656 Missing compiler required member 27 Apr 2020 10:00 #14256

    • robert
    • robert's Avatar


  • Posts: 3595
  • Matt,

    I suspect that this is caused by a setting at the project level, just like your ticket #373 on Github.
    Can you mail us an example ?

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Error XS0656 Missing compiler required member 27 Apr 2020 16:50 #14266

    • FoxProMatt
    • FoxProMatt's Avatar
    • Topic Author



    I have explored this situation further...

    In my code there is a Class with public properties, and in the Text/EndText, I had referred to a "This.PkField" class property (wrong name) but the actual property is named "cPkField" (c prefix at front).

    Well, because the Text/EndText referred to a bad property name reference to <<This.PkField>>, Visual studio gives a Warning:

    "Warning XS9094 Type 'TestClass' does not have a member 'PkField'. This gets resolved to a late bound call to its method 'NoIVarGet'


    BUT.. This also causes a Compiler error XS0656 stating "Error XS0656 Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'"


    The Warning finally caught my eye and helped me see what the problem is, because I was first more worried because of the compiler error.

    So when I added the DLL it made the compiler happy, but the Warning about missing property also went away and I thought everything was good until I got a run-time error complaining that "''TestClass' does not contain a definition for 'PkField''

    Bottom line is I had a bad property reference in my code, and because I am still learning this stuff, it took me a while to figure out from the help that Visual Studio was giving me.

    The bad thing about this case is that with the DLL added to the project, you loose all the help that the compiler can give you (from Warnings), and you can get run-time errors because you are not told that you have bad code.


    Here is the code that will demo the error.

    Using System
    Using System.Collections.Generic
    Using System.Linq
    Using System.Text
    
    Using XSharp.Core
    Using XSharp.VFP
    Using XSharp.RT
    Using XSharp.RDD
    
    
    
    FUNCTION Start() As Void Strict
    	
    	Var oTest = TestClass{}
    	
    	oTest.DemoCsharpDllRequiredError()
    		
    	Return
    	
    END FUNCTION
    	
    
    *======================================================================
    Define Class TestClass As Custom
    	
    	Public cTable = "Customers"
    	Public cPkField = "ID"
    	
    	*---------------------------------------------------------------------------------
    	Function DemoCsharpDllRequiredError(uValue)
      
    		Local lcSql
    
    		Text To lcSql Textmerge Noshow
    			Select * From <<This.cTable>> Where <<This.PkField>> = <<uValue>>
    		Endtext
      
    		? lcSql
    	
    		Wait
    		
    		Return
      
    	End Function
      
    End Define
    
    

    Please Log in or Create an account to join the conversation.

    Error XS0656 Missing compiler required member 27 Apr 2020 16:53 #14267

    • robert
    • robert's Avatar


  • Posts: 3595
  • Matt,
    As interesting all of this is, it still does not explain the error.
    Did you have the "enable late binding" compiler option selected ?

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Error XS0656 Missing compiler required member 27 Apr 2020 17:15 #14271

    • FoxProMatt
    • FoxProMatt's Avatar
    • Topic Author



    At first I did not have Allow Late Bind enabled...

    But then I enabled it, and now I don't get any compiler errors or even any run-time errors.

    So this is REALLY BAD...

    I have code that references a non-existing property on an object reference, and at run-time it does not even give an error and Text/EndText generated a text string while totally skipping over the referenced (bad/missing) property. This can certainly lead to big problems in a running app.

    See below I attached a full Solution to demonstrate this problem.

    Please Log in or Create an account to join the conversation.

    Error XS0656 Missing compiler required member 27 Apr 2020 17:39 #14274

    • robert
    • robert's Avatar


  • Posts: 3595
  • Matt,
    You should have seen a runtime error.
    I'll check why that does not happen.
    And w.r.t the compile time errors:
    I'll discuss with the guys what we can do. Maybe can change the compiler to allow undeclared variables for certain class and their subclasses, such as the Empty class, but still generate compiler errors/warnings for other classes.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1