Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

warning XS0436: The type 'Functions' in '' conflicts with the imported type.... 28 Jul 2021 18:18 #19187

  • wriedmann
  • wriedmann's Avatar
  • Topic Author


  • Posts: 2726
  • Hi Robert,
    this message is a followup to this message:

    www.xsharp.eu/forum/suggestions/1829-pos...d-dll?start=20#13811

    I'm working on another WPF/Core dialect application, and have again this warning:
    warning XS0436: The type 'Functions' in '' conflicts with the imported type 'Functions' in 'rdm.AdsSql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f5ab4fed2162a981'. Using the type defined in ''.	16,2	Start.prg	bnAngebotsTool.XStartupCode:Start

    Is there anything I can do to suppress that warning?

    I have that in all my applications where I'm using a similar startup code to detect startup errors:
    using System.Diagnostics
    using System.Runtime.InteropServices
    
    class bnAngebotsTool.XStartupCode
    
    [STAThreadAttribute];
    static method Start as void
    	local oSB			as System.Text.StringBuilder
    
    	try
    
    	Functions.Start()
    
    	catch oEx as Exception
    
    	AllocConsole()
    	oSB			:= System.Text.StringBuilder{}
    	Output( oSB, "An unhandled exception has occurred" )
    	Output( oSB, "===================================" )
    	do while oEx != null
    		Output( oSB, "Exception: " + oEx:Message )
    		Output( oSB, "Callstack:")
    		Output( oSB, oEx:StackTrace )
    		Output( oSB, "" )
    		oEx				:= oEx:InnerException
    	enddo
    	Output( oSB, "===================================" )
    	Output( oSB, "Press return to close the application" )
    	Wait()
    	System.IO.File.AppendAllText( System.IO.Path.Combine( AppDomain.CurrentDomain:BaseDirectory, "ApplicationError.log" ), oSB:ToString() )
    
    	end try
    
    	return
    
    static method Output( oSB as System.Text.StringBuilder, cText as string ) as void
    
    	oSB:AppendLine( cText )
    	Console.WriteLine( cText )
    
    	return
    
    static method Wait() as void
    
    	Console.ReadLine()
    
    	return
    
    [DllImport("kernel32.dll", SetLastError := true)];
    [return: MarshalAs(UnmanagedType.Bool)];
    static extern method AllocConsole() as logic
    
    [DllImport("user32.dll", CharSet := CharSet.Ansi)];
    static method MessageBox(hwnd as IntPtr, lpText as string, lpCaption as string, uType as dword) as int pascal
    
    end class
    
    [STAThreadAttribute];
    function Start() as int
    	local oApp as App
    
    	try
    
    	oApp 		:= App{}
    
    	oApp:Run()
    
    	catch oException as System.Exception
    
    	rdm.WPFLib.WPFUtility.DisplayException( oException )
    
    	end try
    
    	return 0

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    warning XS0436: The type 'Functions' in '' conflicts with the imported type.... 28 Jul 2021 20:51 #19191

    • robert
    • robert's Avatar


  • Posts: 2308
  • Wolfgang,

    Can you try this:
    Create a Helper function Named MyStart() with the following contents:

    [STAThreadAttribute];
    function MyStart() as int
    return Start()

    and then inside the Start method call MyStart() (do not prefix it with "Functions.")

    Robert
    XSharp Development Team
    The Netherlands

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

    warning XS0436: The type 'Functions' in '' conflicts with the imported type.... 28 Jul 2021 21:03 #19193

    • wriedmann
    • wriedmann's Avatar
    • Topic Author


  • Posts: 2726
  • Hi Robert,
    thank you very much, that works.
    Il will now implement it in all my WPF applications where I have that warning (at least a dozen.....)
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    • Page:
    • 1