Bug Report T319092
Visible to All Users

“Unhandled Exception box” while managing Object Data Sources in the designer

created 9 years ago

Dear Support,

I’ve attached a repro case of a problem that we are experiencing. The example significantly cutdown, but the gist of is it that attempting to edit a data source in a DashboardDesigner generates popups and exceptions. The important difference between what we are doing and typical usage cases is that we are an unmanaged application which loads the .Net framework “on demand” to run managed code.
To reproduce the problem:

  1. Build the attached solution, it contains 3 projects.
  2. Start the ConsoleApplication1 project (without debugging)
    1. You should see a console application (unmanaged) start and then
    2. A Windows.Forms form containing a Ribbon and a Dashboard
  3. Select the “Data Source” tab
  4. Click “Edit”
    1. You should see the message box “No suitable object was found….”
  5. Click “OK”
    1. You now get an Unhandled Exception dialog box: “Object reference not set to an instance of an object”
  6. Click “Continue”
  7. Press “Edit” again
    1. You now see a “Configure Data Source” dialog box, with no sources listed.
  8. Close all the Forms to exit the application
  9. If you just run  WindowsFormsApplication1.exe and go through steps 1-4, you should see a dialog that allows navigation to the data sources.
    I’ve had a sneaky look at the code with the debugger and .Net Reflector (http://www.red-gate.com), and it looks like the DevExpress assemblies call GetEntryAssembly to try to locate potential data sources. In this scenario this returns null, because the entry point to the program is an unmanaged binary.

I think our initial problems/questions are:

  1. What’s the cause of the “Unhandled Exception box”? Is that a bug in the DevExpress code, or a result of something else we’re doing wrong.
  2. Would it be possible, in the case where GetEntryAssembly returns null, to locate data sources in other assemblies?
  3. Why does the “Edit” button behave differently the 2nd time you click it?
     Thank you,
    Alexey
Show previous comments (2)
AM AM
Alexey Miroshnikov 9 years ago

    Part 4 of 4
    …and message text reformatted:
    I’ve attached a repro case of a problem that we are experiencing. The example significantly cutdown, but the gist of is it that attempting to edit a data source in a DashboardDesigner generates popups and exceptions. The important difference between what we are doing and typical usage cases is that we are an unmanaged application which loads the .Net framework “on demand” to run managed code.
    To reproduce the problem:

    1. Build the attached solution, it contains 3 projects.
    2. Start the ConsoleApplication1 project (without debugging)
        a. You should see a console application (unmanaged) start and then
        b. A Windows.Forms form containing a Ribbon and a Dashboard
    3. Select the “Data Source” tab
    4. Click “Edit”
        a. You should see the message box “No suitable object was found….”
    5. Click “OK”
        a. You now get an Unhandled Exception dialog box: “Object reference not set to an instance of an object”
    6. Click “Continue”
    7. Press “Edit” again
        a. You now see a “Configure Data Source” dialog box, with no sources listed.
    8. Close all the Forms to exit the application
    9. If you just run  WindowsFormsApplication1.exe and go through steps 1-4, you should see a dialog that allows navigation to the data sources.

    I’ve had a sneaky look at the code with the debugger and .Net Reflector (http://www.red-gate.com), and it looks like the DevExpress assemblies call GetEntryAssembly to try to locate potential data sources. In this scenario this returns null, because the entry point to the program is an unmanaged binary.
    I think our initial problems/questions are:

    1. What’s the cause of the “Unhandled Exception box”? Is that a bug in the DevExpress code, or a result of something else we’re doing wrong.
    2. Would it be possible, in the case where GetEntryAssembly returns null, to locate data sources in other assemblies?
    3. Why does the “Edit” button behave differently the 2nd time you click it?
    DevExpress Support Team 9 years ago

      Hi Alexey,

      Thank you for posting your sample project. We will examine this behavior in greater detail and will check for a suitable solution. Your patience is appreciated.

      DevExpress Support Team 9 years ago

        Alexey,
        Thank you for your patience.
        We reproduced this issue and passed it to our developers for further research. Once we have any news, we will update this thread.

        Answers approved by DevExpress Support

        created 9 years ago (modified 9 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        Additional information:

        Hello Alexey,
        We made some changes in our source to support staring the dashboard designer from the C++ application. On the other hand, it is necessary to provide a few changes in your original sample as well (We've modified the way to load assemblies). Please see the attachment. Feel free to contact us in case of any questions. We are ready to help you at any time.

          Show previous comments (8)
          DevExpress Support Team 9 years ago

            I have managed to replicate the problem on my side, but I was unable to determine the cause of the issue. Based on the exception callstack it looks like the problem appears because the CustomSolutionTypesProvider is not registered. Refer to the following code that demonstrates this solution:

            C#
            public class CustomSolutionTypesProvider: RuntimeSolutionTypesProvider { static Assembly CurrentAssembly { get { return typeof(CustomSolutionTypesProvider).Assembly; } } public CustomSolutionTypesProvider(): base (()=> CurrentAssembly.GetTypes()) { } protected override string GetActiveProjectAssemblyFullName() { return CurrentAssembly.FullName; } } public class DataSourceWizardCustomization : IDashboardDataSourceWizardCustomization { public void CustomizeDataSourceWizard(IWizardCustomization<DashboardDataSourceModel> customization) { FieldInfo fi = customization.GetType().GetField("container", BindingFlags.NonPublic | BindingFlags.Instance); if(fi != null) { IntegrityContainer integrityContainer = (IntegrityContainer)fi.GetValue(customization); integrityContainer.RegisterInstance<ISolutionTypesProvider>(new CustomSolutionTypesProvider()); } } }

            If the CustomSolutionTypesProvider is registered but the problem appears, please provide us a sample project demonstrating the problem. We will test it locally and will do our best to find a solution for you.

            AM AM
            Alexey Miroshnikov 9 years ago

              Version 15.2.7 I've just downloaded does not show the effects discussed above. Thank you.

              DevExpress Support Team 9 years ago

                I am happy to hear that the problem is not resolved. Thank you for informing me of that.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.