Plex 2E

Expand all | Collapse all

Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

Jump to Best Answer
  • 1.  Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-02-2014 09:40 AM

    Hi,

     

    I hope this is in the right section of the forum.

     

    I am trying to start my (.NET, WinForms) project that uses Plex for accessing our system i DB2 using "F5".

    So I'm trying to debug the solution.

     

    However, I get the following exception:

     

    Object reference not set to an instance of an object.

      at ObRun.ObEnvironment.ObRunOptions.saveLoginInfo(String location, Boolean system, Boolean user, Boolean password)

       at ObRun.ObMain.ObApplication.saveLoginInfo(String location, Boolean system, Boolean user, Boolean password)

     

    when trying to call:

     

    obApplicationUser.saveLoginInfo(locationString, true, true, true);

     

    If I start the application with Ctrl+F5 (no debugging) it starts just fine.

    is there any way I can get it to start in debug?

     

    Thanks,

    rafa



  • 2.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-07-2014 02:52 PM

    Anybody able to offer help to raphi.schobi?

    Raphael Schober wrote:

     

    Hi,

     

    I hope this is in the right section of the forum.

     

    I am trying to start my (.NET, WinForms) project that uses Plex for accessing our system i DB2 using "F5".

    So I'm trying to debug the solution.

     

    However, I get the following exception:

     

    Object reference not set to an instance of an object.

      at ObRun.ObEnvironment.ObRunOptions.saveLoginInfo(String location, Boolean system, Boolean user, Boolean password)

       at ObRun.ObMain.ObApplication.saveLoginInfo(String location, Boolean system, Boolean user, Boolean password)

     

    when trying to call:

     

    obApplicationUser.saveLoginInfo(locationString, true, true, true);

     

    If I start the application with Ctrl+F5 (no debugging) it starts just fine.

    is there any way I can get it to start in debug?

     

    Thanks,

    rafa



  • 3.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-08-2014 09:56 PM

    Hi,

     

    By reading the runtime code, the only possible exception scenario for this API call is when Plex runtime config file isn't found.

    So it might be that When you run F5, pure Debug mode, Plex runtime might try to look for the config file under debug folder or so?

     

    I am not sure how you deploy Plex runtime with your .NET app, but if you only have plex config file either only in release folder or Debug folder, please copy it and try.

     

    HTH,

    Kiyoshi



  • 4.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-09-2014 08:30 AM

    Hi Kiyoshi,

     

    we deploy it by delivering the respective dlls that we reference.

    I checked on my dev pc, and i really cannot make sense of it. The config files are in the places they need to be, and it works if started with ctrl+F5, or double clicking the exe in the debug folder or release folder, but with F5 it crashes.

    Maybe another clue, this is what i see when i remove the .save call to ObApplication to the very end of our application, so after the main loop:

     

    Capture.PNG

    so it seems like the config(s) are just completely ignored.

    is there anything i can call to manually instantiate/initialize the plex components? but why would it work then if started normally..

     

    Thanks,

    rafa



  • 5.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-09-2014 11:18 AM

    Hi, Rafa

     

    I think Plex runtime has a logic to look up the config file so that might be effected the way it works with F5 or ctrl+F5.

    But I want to confirm one thing.

    In your VS project when you add reference to Plex .NET runtime, you added the config file to the project as well? And set action like 'Copy if newer'?

     

    Regards,

    Kiyoshi



  • 6.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-10-2014 04:13 AM

    Hi,

     

    so, just to clarify, when you say config, you are talking about the PlexRuntime configsection in app.config, right?

    this file is copied yes. Is there another config file that is required and might only be properly referenced in non-debug mode?

     

    Thanks,

    rafa



  • 7.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-10-2014 10:01 AM

    I will be out of the office starting  10.10.2014 and will not return until

    20.10.2014.

     

    I will respond to your message when I return. Your mail will not be

    forwarded. In urgent cases please contact our administration.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Ich bis 20.10.2014 nicht im Büro.

    Ihre Mail wird nicht automatisch weitergeleitet.

    Ich werde Ihre Mail nach meiner Rückkehr beantworten.

    In dringenden technischen Fällen kontaktieren Sie bitte unsere Hotline in

    Reinach (061/716 94 49) oder unsere Zentrale in Reinach (061/716 94 44)



  • 8.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-10-2014 10:50 AM

    Hi again,

    could you help me maybe finding an API/method call that would allow me to manually pass a config file in the code?

     

    Thanks and have a nice weekend!

    rafa



  • 9.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-10-2014 12:49 PM

    Before move forward,

     

    Could you share how you are using Plex runtime related config information for your Winform app?

    Probably two way, I can think of.

    • Have Plex.ObRun.dll.config with your application deployment folder along with Plex.ObRun.dll if this is a case, you adding Plex.ObRun.dll.config to your Winform App Visual Studio project and let it copied to build folder (In the other hand not manually.)
    • You have manually copy the contents of  Plex.ObRun.dll.config to your main exe.config file.

     

    Kiyoshi



  • 10.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-10-2014 04:01 PM

    I will be out of the office starting  10.10.2014 and will not return until

    20.10.2014.

     

    I will respond to your message when I return. Your mail will not be

    forwarded. In urgent cases please contact our administration.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Ich bis 20.10.2014 nicht im Büro.

    Ihre Mail wird nicht automatisch weitergeleitet.

    Ich werde Ihre Mail nach meiner Rückkehr beantworten.

    In dringenden technischen Fällen kontaktieren Sie bitte unsere Hotline in

    Reinach (061/716 94 49) oder unsere Zentrale in Reinach (061/716 94 44)



  • 11.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-13-2014 03:50 AM

    Hi,

     

    yes, the config is copied into our app.config file.

    below is the relevant part (I xx-ed out some parts)

     

    would you have a link to a howto/help section that explains exactly what is needed and what each section/attribute does? so that i can try and rebuild the whole config with only what is necessary?

    when listing the configurationfilepaths the config exists under the relevant path, but whenever started with debug mode, it just acts like it doesnt. or is there anything that needs to happen?

    is there a way of programmatically configuring/passing the config file to the plex runtime?

     

    Thanks for your help!

     

    <?xml version="1.0" encoding="utf-8"?>

    <configuration>

      <configSections>

        <sectionGroup name="PlexRuntime" type="System.Configuration.ConfigurationSectionGroup, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

          <sectionGroup name="PlexGenericRuntime" type="System.Configuration.ConfigurationSectionGroup, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

            <section name="PlexGenericRuntime" type="Plex.Common.Configuration.RuntimeSettings, Plex.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cf298e6f087b398a" allowLocation="true" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="true" />

            <sectionGroup name="Environments" type="System.Configuration.ConfigurationSectionGroup, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

              <sectionGroup name="Default" type="System.Configuration.ConfigurationSectionGroup, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

                <section name="Default" type="Plex.Common.Configuration.EnvironmentSettings, Plex.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cf298e6f087b398a" allowLocation="true" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="true" />

                <sectionGroup name="Databases" type="System.Configuration.ConfigurationSectionGroup, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

                  <section name="Default" type="Plex.Common.Configuration.DatabaseSettings, Plex.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cf298e6f087b398a" allowLocation="true" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="true" />

                </sectionGroup>

              </sectionGroup>

            </sectionGroup>

            <sectionGroup name="Locations" type="System.Configuration.ConfigurationSectionGroup, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

              <section name="Default_x0020_C_x0023_" type="Plex.Common.Configuration.LocationSettings, Plex.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cf298e6f087b398a" allowLocation="true" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="true" />

              <section name="Default_x0020_Java" type="Plex.Common.Configuration.LocationSettings, Plex.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cf298e6f087b398a" allowLocation="true" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="true" />

              <section name="Default_x0020_RPG" type="Plex.Common.Configuration.LocationSettings, Plex.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cf298e6f087b398a" allowLocation="true" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="true" />

            </sectionGroup>

          </sectionGroup>

        </sectionGroup>

      </configSections>

      <PlexRuntime>

        <PlexGenericRuntime>

          <PlexGenericRuntime nodeType="Runtime" port="1998" version="" spVersion="0" maximumClients="100" culture="de-CH" useLogging="true" loggingLevel="Full" logType="FlatText" runtimeExceptions="Log" secureConnection="false" sslCipherSuites="" dynamicProviders="" nodeID="" />

          <Environments>

            <Default>

              <Default nodeType="Environment" culture="de-CH" assemblyList=***.dll

                dateMask="MM/dd/yyyy" timeMask="HH:mm:ss a" datetimeMask="MM/dd/yyyy HH:mm:ss a"

                characterTrimSpaces="true" characterEmptyValue="" characterLowValue=""

                characterHighValue="z" dateEmptyValue="0001-01-01" dateLowValue="0001-01-01"

                dateHighValue="9999-12-31" timeEmptyValue="00:00:00" timeLowValue="00:00:00"

                timeHighValue="23:59:59" timestampEmptyValue="0001-01-01 00:00:00"

                timestampLowValue="0001-01-01 00:00:00" timestampHighValue="9999-12-31 23:59:59"

                nodeID="" />

              <Databases>

                <Default nodeType="Database" connectionString="File Name=C:/local.udl" udlFileName="C:/local.udl" user="" password="" autoCommit="true" readOnlyAccess="false" transactionIsolation="Unspecified" sqlQueryTimeout="60" nodeID="" />

              </Databases>

            </Default>

          </Environments>

          <Locations>

            <Default_x0020_C_x0023_ environment="Default" user="" password="" secureConnection="false" sslCipherSuites="" dynamicProviders="" system="*THIS" port="1998" encoding="" protocol="CSHARPTCPIP" jobDescription="Plex610/Plex610" additionalEncryption="None" nodeType="Location" nodeID="" />

            <Default_x0020_Java environment="Default" user="" password="" secureConnection="false" sslCipherSuites="" dynamicProviders="" system="localhost" port="1998" encoding="" protocol="JAVATCPIP" jobDescription="Plex610/Plex610" additionalEncryption="None" nodeType="Location" nodeID="" />

            <Default_x0020_RPG environment="Default" user="" password=""

              secureConnection="false" sslCipherSuites="" dynamicProviders=""

              system="xx" port="xxxxx" encoding="IBM500" protocol="AS400TCPIP"

              jobDescription="xxxxx" additionalEncryption="None"

              nodeType="Location" nodeID="nciAY0V/QEO4WpKB1qUgFrhkXIsV2YwVkdaoo4vzIGo=" />

          </Locations>

        </PlexGenericRuntime>

      </PlexRuntime>



  • 12.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-13-2014 04:01 AM

    I will be out of the office starting  10.10.2014 and will not return until

    20.10.2014.

     

    I will respond to your message when I return. Your mail will not be

    forwarded. In urgent cases please contact our administration.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Ich bis 20.10.2014 nicht im Büro.

    Ihre Mail wird nicht automatisch weitergeleitet.

    Ich werde Ihre Mail nach meiner Rückkehr beantworten.

    In dringenden technischen Fällen kontaktieren Sie bitte unsere Hotline in

    Reinach (061/716 94 49) oder unsere Zentrale in Reinach (061/716 94 44)



  • 13.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio
    Best Answer

    Posted 10-13-2014 03:53 PM

    Hi,

     

    Please try my first approach. This way you don't need to mixed up your main exe config and Plex runtime config.

    We needed to improve the config file loading at Plex 6.1 PTF to deal .NET runtime as WCF Service where we don't have an access of 'main' executable from Plex runtime.

     

    • Have Plex.ObRun.dll.config with your application deployment folder along with Plex.ObRun.dll if this is a case, you adding Plex.ObRun.dll.config to your Winform App Visual Studio project and let it copied to build folder (In the other hand not manually.)

     

    Also just in case you are not be aware of, Since Plex r7.0, Plex generates .NET Client using WPF (Windows Presentation Foundation)  from the model.

    I know you have own Winform investment but please check it out!

     

    Regards,

    Kiyoshi



  • 14.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-13-2014 10:01 PM

    I will be out of the office starting  10.10.2014 and will not return until

    20.10.2014.

     

    I will respond to your message when I return. Your mail will not be

    forwarded. In urgent cases please contact our administration.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Ich bis 20.10.2014 nicht im Büro.

    Ihre Mail wird nicht automatisch weitergeleitet.

    Ich werde Ihre Mail nach meiner Rückkehr beantworten.

    In dringenden technischen Fällen kontaktieren Sie bitte unsere Hotline in

    Reinach (061/716 94 49) oder unsere Zentrale in Reinach (061/716 94 44)



  • 15.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-14-2014 02:55 AM

    Hi,

     

    so this fixed it. (creating the Plex.ObRun.dll.config)

    thanks a lot!

    now, could you please explain to me, or point me to documentation that explains how the config works?

    which parts can i remove, which parts are necessary, what do they do etc?

     

    Thanks again for your help,

    rafa



  • 16.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-14-2014 04:01 AM

    I will be out of the office starting  10.10.2014 and will not return until

    20.10.2014.

     

    I will respond to your message when I return. Your mail will not be

    forwarded. In urgent cases please contact our administration.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Ich bis 20.10.2014 nicht im Büro.

    Ihre Mail wird nicht automatisch weitergeleitet.

    Ich werde Ihre Mail nach meiner Rückkehr beantworten.

    In dringenden technischen Fällen kontaktieren Sie bitte unsere Hotline in

    Reinach (061/716 94 49) oder unsere Zentrale in Reinach (061/716 94 44)



  • 17.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-14-2014 01:24 PM

    Hi, Rafa

     

    Glad it works now for you.

    Since your usage is a kind of unexpected way from Plex generated .NET application point of view, there is no exactly matching information available for you. But I found this statement in CA Plex 7.1 doc.

    It outline what you are seeking.

    Although, I agree why the config info you set in your main exe.config isn't loaded when you debug it, but to investigate that part, I hope you happy with solution you get now.

    Which is have 'Plex.ObRun.dll.config' avaialbe where Plex.ObRun.dll will be deployed. And not to have the Plex runtime config in your main exe.config.

    That saves you copy paste and wandering where you needs to copy etc.

     

    If you are happy for the solution make my prior post as solution and make it answered.

     

    Thanks,

    Kiyoshi

     

    Here is a statement from CA Plex r7.1 help.

    ############################################################

     

    Note: The Configuration file associated with the executable being run attempts to load first. If that config is not found, the CA Plex .NET runtime attempts to look for a Plex.ObRun.dll.config instance to configure the runtime. The runtime searches the current working directory for these configuration files and looks in the <ApplicationData>\CA\Plex\7.1\ob.Net installation folder.



  • 18.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-14-2014 04:01 PM

    I will be out of the office starting  10.10.2014 and will not return until

    20.10.2014.

     

    I will respond to your message when I return. Your mail will not be

    forwarded. In urgent cases please contact our administration.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Ich bis 20.10.2014 nicht im Büro.

    Ihre Mail wird nicht automatisch weitergeleitet.

    Ich werde Ihre Mail nach meiner Rückkehr beantworten.

    In dringenden technischen Fällen kontaktieren Sie bitte unsere Hotline in

    Reinach (061/716 94 49) oder unsere Zentrale in Reinach (061/716 94 44)



  • 19.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-15-2014 02:42 AM

    Thanks,

    but what I meant by "how the config works" is, is there documentation about how to actually write the config file? as in, what do each of the XML elements and attributes specify?

     

    rafa



  • 20.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-15-2014 04:01 AM

    I will be out of the office starting  10.10.2014 and will not return until

    20.10.2014.

     

    I will respond to your message when I return. Your mail will not be

    forwarded. In urgent cases please contact our administration.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Ich bis 20.10.2014 nicht im Büro.

    Ihre Mail wird nicht automatisch weitergeleitet.

    Ich werde Ihre Mail nach meiner Rückkehr beantworten.

    In dringenden technischen Fällen kontaktieren Sie bitte unsere Hotline in

    Reinach (061/716 94 49) oder unsere Zentrale in Reinach (061/716 94 44)



  • 21.  Re: Plex.ObRun.dll null reference exception when trying to F5 debug from Visual Studio

    Posted 10-10-2014 04:01 PM

    I will be out of the office starting  10.10.2014 and will not return until

    20.10.2014.

     

    I will respond to your message when I return. Your mail will not be

    forwarded. In urgent cases please contact our administration.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Ich bis 20.10.2014 nicht im Büro.

    Ihre Mail wird nicht automatisch weitergeleitet.

    Ich werde Ihre Mail nach meiner Rückkehr beantworten.

    In dringenden technischen Fällen kontaktieren Sie bitte unsere Hotline in

    Reinach (061/716 94 49) oder unsere Zentrale in Reinach (061/716 94 44)