Skip to content

Calling external .dll fails after upgrading to .NET 8 #52761

@Schoof-T

Description

@Schoof-T

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have a .dll file from a company that I need to call to process some work. The dll is created in powerbuilder.

The .dll required the application to be x86, required Winforms and a bunch of powerbuilder dlls.
I created an API as a wrapper around this .dll, I simply referenced the .dll file
image

and called it's methods:

 var generators = new Abs_Pdf();

 if (model.PageSize.HasValue && model.Orientation.HasValue)
 {
     generators.set_pdf_size(model.PageSize.Value, model.Orientation.Value);
 }

 _logger.LogInformation("Start Converting Template To Pdf - {table}:{id}", model.TablePrefix, model.PrimaryKey);

 var result = generators.get_template_pdf_file(model.TablePrefix, model.PrimaryKey, ref outputPath);

This all worked until I wanted to upgrade my API to .NET 8. Now calling the dll gives an exception (the exception is caught in the dll I assume, because it's simply returning a string saying "Failed!".

Are there any changes to calling a referenced library?

I also contacted the company and asked them, but seeing as it worked in .NET 7, I thought maybe it should/could work in .NET 8 as well.

Expected Behavior

Calling the .dll library would not result in an error.

Steps To Reproduce

I cannot share the .dll as it is intellectual property.

  • Create new .NET 7 API project
  • Add external library (dll)
  • Call external library --> Success
  • Upgrade to .NET 8
  • Call external library --> Fail

Exceptions (if any)

No response

.NET Version

8.0.100

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.old-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions