Presentationcore in asp.net core 5.0

Marco Salvatori 191 Reputation points
2021-02-13T11:01:32.377+00:00

Hello,
I have to implement the Point, Pointcollection, vector classes in asp.net core 5.0.
it returns me an error simply to create a pointcollection

PointCollection test = new PointCollection ();

the error returned is:
System.BadImageFormatException: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)

help?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,557 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sam Wu-MSFT 7,526 Reputation points Microsoft Vendor
    2021-02-15T07:00:23.023+00:00

    Hi @Marco Salvatori ,

    System.BadImageFormatException: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)

    Did you post this error on iis? If so, you can try the solution below:

    1. Delete the PresentationCore package from the Bin folder and rebuild project.
    2. There may be a problem caused by binary format compatibility, set Enable 32-bit Applications to True or False.
      68049-58.png

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.